Merge lp:~cjwatson/launchpad/minimal-recipe-text-bzr into lp:launchpad

Proposed by Colin Watson on 2016-01-11
Status: Merged
Merged at revision: 17888
Proposed branch: lp:~cjwatson/launchpad/minimal-recipe-text-bzr
Merge into: lp:launchpad
Prerequisite: lp:~cjwatson/launchpad/sprd-utilities
Diff against target: 163 lines (+16/-16)
5 files modified
lib/lp/code/browser/sourcepackagerecipe.py (+2/-2)
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+8/-8)
lib/lp/code/interfaces/sourcepackagerecipe.py (+2/-2)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+2/-2)
lib/lp/testing/factory.py (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/launchpad/minimal-recipe-text-bzr
Reviewer Review Type Date Requested Status
William Grant code 2016-01-11 Approve on 2016-01-12
Review via email: mp+282231@code.launchpad.net

Commit message

Rename MINIMAL_RECIPE_TEXT to MINIMAL_RECIPE_TEXT_BZR.

Description of the change

Rename MINIMAL_RECIPE_TEXT to MINIMAL_RECIPE_TEXT_BZR. git-build-recipe is going to want something slightly different here, so this is a bit of preliminary refactoring before putting Git recipes in place.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
--- lib/lp/code/browser/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
+++ lib/lp/code/browser/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
@@ -94,7 +94,7 @@
94 IRecipeBranchSource,94 IRecipeBranchSource,
95 ISourcePackageRecipe,95 ISourcePackageRecipe,
96 ISourcePackageRecipeSource,96 ISourcePackageRecipeSource,
97 MINIMAL_RECIPE_TEXT,97 MINIMAL_RECIPE_TEXT_BZR,
98 )98 )
99from lp.code.model.branchtarget import PersonBranchTarget99from lp.code.model.branchtarget import PersonBranchTarget
100from lp.code.vocabularies.sourcepackagerecipe import BuildableDistroSeries100from lp.code.vocabularies.sourcepackagerecipe import BuildableDistroSeries
@@ -761,7 +761,7 @@
761 SeriesStatus.CURRENT, SeriesStatus.DEVELOPMENT)]761 SeriesStatus.CURRENT, SeriesStatus.DEVELOPMENT)]
762 return {762 return {
763 'name': self._find_unused_name(self.user),763 'name': self._find_unused_name(self.user),
764 'recipe_text': MINIMAL_RECIPE_TEXT % self.context.bzr_identity,764 'recipe_text': MINIMAL_RECIPE_TEXT_BZR % self.context.bzr_identity,
765 'owner': self.user,765 'owner': self.user,
766 'distroseries': series,766 'distroseries': series,
767 'build_daily': True,767 'build_daily': True,
768768
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2015-09-28 17:38:45 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
@@ -34,7 +34,7 @@
34from lp.code.browser.sourcepackagerecipebuild import (34from lp.code.browser.sourcepackagerecipebuild import (
35 SourcePackageRecipeBuildView,35 SourcePackageRecipeBuildView,
36 )36 )
37from lp.code.interfaces.sourcepackagerecipe import MINIMAL_RECIPE_TEXT37from lp.code.interfaces.sourcepackagerecipe import MINIMAL_RECIPE_TEXT_BZR
38from lp.code.tests.helpers import recipe_parser_newest_version38from lp.code.tests.helpers import recipe_parser_newest_version
39from lp.registry.interfaces.person import TeamMembershipPolicy39from lp.registry.interfaces.person import TeamMembershipPolicy
40from lp.registry.interfaces.pocket import PackagePublishingPocket40from lp.registry.interfaces.pocket import PackagePublishingPocket
@@ -449,7 +449,7 @@
449 def test_create_recipe_bad_base_branch(self):449 def test_create_recipe_bad_base_branch(self):
450 # If a user tries to create source package recipe with a bad base450 # If a user tries to create source package recipe with a bad base
451 # branch location, they should get an error.451 # branch location, they should get an error.
452 browser = self.createRecipe(MINIMAL_RECIPE_TEXT % 'foo')452 browser = self.createRecipe(MINIMAL_RECIPE_TEXT_BZR % 'foo')
453 self.assertEqual(453 self.assertEqual(
454 get_feedback_messages(browser.contents)[1],454 get_feedback_messages(browser.contents)[1],
455 'foo is not a branch on Launchpad.')455 'foo is not a branch on Launchpad.')
@@ -461,7 +461,7 @@
461 name='ratatouille', displayname='Ratatouille')461 name='ratatouille', displayname='Ratatouille')
462 branch = self.factory.makeBranch(462 branch = self.factory.makeBranch(
463 owner=self.chef, product=product, name='veggies')463 owner=self.chef, product=product, name='veggies')
464 recipe = MINIMAL_RECIPE_TEXT % branch.bzr_identity464 recipe = MINIMAL_RECIPE_TEXT_BZR % branch.bzr_identity
465 recipe += 'nest packaging foo debian'465 recipe += 'nest packaging foo debian'
466 browser = self.createRecipe(recipe, branch)466 browser = self.createRecipe(recipe, branch)
467 self.assertEqual(467 self.assertEqual(
@@ -518,7 +518,7 @@
518 owner=self.user, information_type=InformationType.USERDATA)518 owner=self.user, information_type=InformationType.USERDATA)
519 with person_logged_in(self.user):519 with person_logged_in(self.user):
520 bzr_identity = branch.bzr_identity520 bzr_identity = branch.bzr_identity
521 recipe_text = MINIMAL_RECIPE_TEXT % bzr_identity521 recipe_text = MINIMAL_RECIPE_TEXT_BZR % bzr_identity
522 browser = self.createRecipe(recipe_text)522 browser = self.createRecipe(recipe_text)
523 self.assertEqual(523 self.assertEqual(
524 get_feedback_messages(browser.contents)[1],524 get_feedback_messages(browser.contents)[1],
@@ -761,7 +761,7 @@
761 browser.getControl(name='field.name').value = 'fings'761 browser.getControl(name='field.name').value = 'fings'
762 browser.getControl('Description').value = 'This is stuff'762 browser.getControl('Description').value = 'This is stuff'
763 browser.getControl('Recipe text').value = (763 browser.getControl('Recipe text').value = (
764 MINIMAL_RECIPE_TEXT % meat_path)764 MINIMAL_RECIPE_TEXT_BZR % meat_path)
765 browser.getControl('Secret Squirrel').click()765 browser.getControl('Secret Squirrel').click()
766 browser.getControl('Mumbly Midget').click()766 browser.getControl('Mumbly Midget').click()
767 browser.getControl('PPA 2').click()767 browser.getControl('PPA 2').click()
@@ -828,7 +828,7 @@
828 browser.getControl(name='field.name').value = 'fings'828 browser.getControl(name='field.name').value = 'fings'
829 browser.getControl('Description').value = 'This is stuff'829 browser.getControl('Description').value = 'This is stuff'
830 browser.getControl('Recipe text').value = (830 browser.getControl('Recipe text').value = (
831 MINIMAL_RECIPE_TEXT % meat_path)831 MINIMAL_RECIPE_TEXT_BZR % meat_path)
832 browser.getControl('Secret Squirrel').click()832 browser.getControl('Secret Squirrel').click()
833 browser.getControl('Mumbly Midget').click()833 browser.getControl('Mumbly Midget').click()
834 browser.getControl('Update Recipe').click()834 browser.getControl('Update Recipe').click()
@@ -926,7 +926,7 @@
926 browser.getControl(name='field.name').value = 'fings'926 browser.getControl(name='field.name').value = 'fings'
927 browser.getControl('Description').value = 'This is stuff'927 browser.getControl('Description').value = 'This is stuff'
928 browser.getControl('Recipe text').value = (928 browser.getControl('Recipe text').value = (
929 MINIMAL_RECIPE_TEXT % meat_path)929 MINIMAL_RECIPE_TEXT_BZR % meat_path)
930 browser.getControl('Secret Squirrel').click()930 browser.getControl('Secret Squirrel').click()
931 browser.getControl('Mumbly Midget').click()931 browser.getControl('Mumbly Midget').click()
932 browser.getControl('Update Recipe').click()932 browser.getControl('Update Recipe').click()
@@ -943,7 +943,7 @@
943 owner=self.user, information_type=InformationType.USERDATA)943 owner=self.user, information_type=InformationType.USERDATA)
944 with person_logged_in(self.user):944 with person_logged_in(self.user):
945 bzr_identity = branch.bzr_identity945 bzr_identity = branch.bzr_identity
946 recipe_text = MINIMAL_RECIPE_TEXT % bzr_identity946 recipe_text = MINIMAL_RECIPE_TEXT_BZR % bzr_identity
947 browser = self.getViewBrowser(recipe, '+edit')947 browser = self.getViewBrowser(recipe, '+edit')
948 browser.getControl('Recipe text').value = recipe_text948 browser.getControl('Recipe text').value = recipe_text
949 browser.getControl('Update Recipe').click()949 browser.getControl('Update Recipe').click()
950950
=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
--- lib/lp/code/interfaces/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
+++ lib/lp/code/interfaces/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
@@ -13,7 +13,7 @@
13 'ISourcePackageRecipeData',13 'ISourcePackageRecipeData',
14 'ISourcePackageRecipeDataSource',14 'ISourcePackageRecipeDataSource',
15 'ISourcePackageRecipeSource',15 'ISourcePackageRecipeSource',
16 'MINIMAL_RECIPE_TEXT',16 'MINIMAL_RECIPE_TEXT_BZR',
17 ]17 ]
1818
1919
@@ -66,7 +66,7 @@
66from lp.soyuz.interfaces.archive import IArchive66from lp.soyuz.interfaces.archive import IArchive
6767
6868
69MINIMAL_RECIPE_TEXT = dedent(u'''\69MINIMAL_RECIPE_TEXT_BZR = dedent(u'''\
70 # bzr-builder format 0.3 deb-version {debupstream}-0~{revno}70 # bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
71 %s71 %s
72 ''')72 ''')
7373
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2015-09-12 00:23:59 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
@@ -38,7 +38,7 @@
38 ISourcePackageRecipe,38 ISourcePackageRecipe,
39 ISourcePackageRecipeSource,39 ISourcePackageRecipeSource,
40 ISourcePackageRecipeView,40 ISourcePackageRecipeView,
41 MINIMAL_RECIPE_TEXT,41 MINIMAL_RECIPE_TEXT_BZR,
42 )42 )
43from lp.code.interfaces.sourcepackagerecipebuild import (43from lp.code.interfaces.sourcepackagerecipebuild import (
44 ISourcePackageRecipeBuild,44 ISourcePackageRecipeBuild,
@@ -997,7 +997,7 @@
997997
998 def makeRecipeText(self):998 def makeRecipeText(self):
999 branch = self.factory.makeBranch()999 branch = self.factory.makeBranch()
1000 return MINIMAL_RECIPE_TEXT % branch.bzr_identity1000 return MINIMAL_RECIPE_TEXT_BZR % branch.bzr_identity
10011001
1002 def makeRecipe(self, user=None, owner=None, recipe_text=None,1002 def makeRecipe(self, user=None, owner=None, recipe_text=None,
1003 version='devel'):1003 version='devel'):
10041004
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2015-10-13 13:22:08 +0000
+++ lib/lp/testing/factory.py 2016-01-11 21:30:07 +0000
@@ -123,7 +123,7 @@
123from lp.code.interfaces.revision import IRevisionSet123from lp.code.interfaces.revision import IRevisionSet
124from lp.code.interfaces.sourcepackagerecipe import (124from lp.code.interfaces.sourcepackagerecipe import (
125 ISourcePackageRecipeSource,125 ISourcePackageRecipeSource,
126 MINIMAL_RECIPE_TEXT,126 MINIMAL_RECIPE_TEXT_BZR,
127 )127 )
128from lp.code.interfaces.sourcepackagerecipebuild import (128from lp.code.interfaces.sourcepackagerecipebuild import (
129 ISourcePackageRecipeBuildSource,129 ISourcePackageRecipeBuildSource,
@@ -2897,7 +2897,7 @@
2897 branches = (self.makeAnyBranch(), )2897 branches = (self.makeAnyBranch(), )
2898 base_branch = branches[0]2898 base_branch = branches[0]
2899 other_branches = branches[1:]2899 other_branches = branches[1:]
2900 text = MINIMAL_RECIPE_TEXT % base_branch.bzr_identity2900 text = MINIMAL_RECIPE_TEXT_BZR % base_branch.bzr_identity
2901 for i, branch in enumerate(other_branches):2901 for i, branch in enumerate(other_branches):
2902 text += 'merge dummy-%s %s\n' % (i, branch.bzr_identity)2902 text += 'merge dummy-%s %s\n' % (i, branch.bzr_identity)
2903 return text2903 return text