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

Proposed by Colin Watson
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 Approve
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.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
2--- lib/lp/code/browser/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
3+++ lib/lp/code/browser/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
4@@ -94,7 +94,7 @@
5 IRecipeBranchSource,
6 ISourcePackageRecipe,
7 ISourcePackageRecipeSource,
8- MINIMAL_RECIPE_TEXT,
9+ MINIMAL_RECIPE_TEXT_BZR,
10 )
11 from lp.code.model.branchtarget import PersonBranchTarget
12 from lp.code.vocabularies.sourcepackagerecipe import BuildableDistroSeries
13@@ -761,7 +761,7 @@
14 SeriesStatus.CURRENT, SeriesStatus.DEVELOPMENT)]
15 return {
16 'name': self._find_unused_name(self.user),
17- 'recipe_text': MINIMAL_RECIPE_TEXT % self.context.bzr_identity,
18+ 'recipe_text': MINIMAL_RECIPE_TEXT_BZR % self.context.bzr_identity,
19 'owner': self.user,
20 'distroseries': series,
21 'build_daily': True,
22
23=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
24--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2015-09-28 17:38:45 +0000
25+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
26@@ -34,7 +34,7 @@
27 from lp.code.browser.sourcepackagerecipebuild import (
28 SourcePackageRecipeBuildView,
29 )
30-from lp.code.interfaces.sourcepackagerecipe import MINIMAL_RECIPE_TEXT
31+from lp.code.interfaces.sourcepackagerecipe import MINIMAL_RECIPE_TEXT_BZR
32 from lp.code.tests.helpers import recipe_parser_newest_version
33 from lp.registry.interfaces.person import TeamMembershipPolicy
34 from lp.registry.interfaces.pocket import PackagePublishingPocket
35@@ -449,7 +449,7 @@
36 def test_create_recipe_bad_base_branch(self):
37 # If a user tries to create source package recipe with a bad base
38 # branch location, they should get an error.
39- browser = self.createRecipe(MINIMAL_RECIPE_TEXT % 'foo')
40+ browser = self.createRecipe(MINIMAL_RECIPE_TEXT_BZR % 'foo')
41 self.assertEqual(
42 get_feedback_messages(browser.contents)[1],
43 'foo is not a branch on Launchpad.')
44@@ -461,7 +461,7 @@
45 name='ratatouille', displayname='Ratatouille')
46 branch = self.factory.makeBranch(
47 owner=self.chef, product=product, name='veggies')
48- recipe = MINIMAL_RECIPE_TEXT % branch.bzr_identity
49+ recipe = MINIMAL_RECIPE_TEXT_BZR % branch.bzr_identity
50 recipe += 'nest packaging foo debian'
51 browser = self.createRecipe(recipe, branch)
52 self.assertEqual(
53@@ -518,7 +518,7 @@
54 owner=self.user, information_type=InformationType.USERDATA)
55 with person_logged_in(self.user):
56 bzr_identity = branch.bzr_identity
57- recipe_text = MINIMAL_RECIPE_TEXT % bzr_identity
58+ recipe_text = MINIMAL_RECIPE_TEXT_BZR % bzr_identity
59 browser = self.createRecipe(recipe_text)
60 self.assertEqual(
61 get_feedback_messages(browser.contents)[1],
62@@ -761,7 +761,7 @@
63 browser.getControl(name='field.name').value = 'fings'
64 browser.getControl('Description').value = 'This is stuff'
65 browser.getControl('Recipe text').value = (
66- MINIMAL_RECIPE_TEXT % meat_path)
67+ MINIMAL_RECIPE_TEXT_BZR % meat_path)
68 browser.getControl('Secret Squirrel').click()
69 browser.getControl('Mumbly Midget').click()
70 browser.getControl('PPA 2').click()
71@@ -828,7 +828,7 @@
72 browser.getControl(name='field.name').value = 'fings'
73 browser.getControl('Description').value = 'This is stuff'
74 browser.getControl('Recipe text').value = (
75- MINIMAL_RECIPE_TEXT % meat_path)
76+ MINIMAL_RECIPE_TEXT_BZR % meat_path)
77 browser.getControl('Secret Squirrel').click()
78 browser.getControl('Mumbly Midget').click()
79 browser.getControl('Update Recipe').click()
80@@ -926,7 +926,7 @@
81 browser.getControl(name='field.name').value = 'fings'
82 browser.getControl('Description').value = 'This is stuff'
83 browser.getControl('Recipe text').value = (
84- MINIMAL_RECIPE_TEXT % meat_path)
85+ MINIMAL_RECIPE_TEXT_BZR % meat_path)
86 browser.getControl('Secret Squirrel').click()
87 browser.getControl('Mumbly Midget').click()
88 browser.getControl('Update Recipe').click()
89@@ -943,7 +943,7 @@
90 owner=self.user, information_type=InformationType.USERDATA)
91 with person_logged_in(self.user):
92 bzr_identity = branch.bzr_identity
93- recipe_text = MINIMAL_RECIPE_TEXT % bzr_identity
94+ recipe_text = MINIMAL_RECIPE_TEXT_BZR % bzr_identity
95 browser = self.getViewBrowser(recipe, '+edit')
96 browser.getControl('Recipe text').value = recipe_text
97 browser.getControl('Update Recipe').click()
98
99=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
100--- lib/lp/code/interfaces/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
101+++ lib/lp/code/interfaces/sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
102@@ -13,7 +13,7 @@
103 'ISourcePackageRecipeData',
104 'ISourcePackageRecipeDataSource',
105 'ISourcePackageRecipeSource',
106- 'MINIMAL_RECIPE_TEXT',
107+ 'MINIMAL_RECIPE_TEXT_BZR',
108 ]
109
110
111@@ -66,7 +66,7 @@
112 from lp.soyuz.interfaces.archive import IArchive
113
114
115-MINIMAL_RECIPE_TEXT = dedent(u'''\
116+MINIMAL_RECIPE_TEXT_BZR = dedent(u'''\
117 # bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
118 %s
119 ''')
120
121=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
122--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2015-09-12 00:23:59 +0000
123+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2016-01-11 21:30:07 +0000
124@@ -38,7 +38,7 @@
125 ISourcePackageRecipe,
126 ISourcePackageRecipeSource,
127 ISourcePackageRecipeView,
128- MINIMAL_RECIPE_TEXT,
129+ MINIMAL_RECIPE_TEXT_BZR,
130 )
131 from lp.code.interfaces.sourcepackagerecipebuild import (
132 ISourcePackageRecipeBuild,
133@@ -997,7 +997,7 @@
134
135 def makeRecipeText(self):
136 branch = self.factory.makeBranch()
137- return MINIMAL_RECIPE_TEXT % branch.bzr_identity
138+ return MINIMAL_RECIPE_TEXT_BZR % branch.bzr_identity
139
140 def makeRecipe(self, user=None, owner=None, recipe_text=None,
141 version='devel'):
142
143=== modified file 'lib/lp/testing/factory.py'
144--- lib/lp/testing/factory.py 2015-10-13 13:22:08 +0000
145+++ lib/lp/testing/factory.py 2016-01-11 21:30:07 +0000
146@@ -123,7 +123,7 @@
147 from lp.code.interfaces.revision import IRevisionSet
148 from lp.code.interfaces.sourcepackagerecipe import (
149 ISourcePackageRecipeSource,
150- MINIMAL_RECIPE_TEXT,
151+ MINIMAL_RECIPE_TEXT_BZR,
152 )
153 from lp.code.interfaces.sourcepackagerecipebuild import (
154 ISourcePackageRecipeBuildSource,
155@@ -2897,7 +2897,7 @@
156 branches = (self.makeAnyBranch(), )
157 base_branch = branches[0]
158 other_branches = branches[1:]
159- text = MINIMAL_RECIPE_TEXT % base_branch.bzr_identity
160+ text = MINIMAL_RECIPE_TEXT_BZR % base_branch.bzr_identity
161 for i, branch in enumerate(other_branches):
162 text += 'merge dummy-%s %s\n' % (i, branch.bzr_identity)
163 return text