Merge lp:~thumper/launchpad/branch-distro-set-old-mature into lp:launchpad

Proposed by Tim Penhey
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 11590
Proposed branch: lp:~thumper/launchpad/branch-distro-set-old-mature
Merge into: lp:launchpad
Diff against target: 58 lines (+10/-2)
3 files modified
database/schema/security.cfg (+1/-1)
lib/lp/codehosting/branchdistro.py (+2/-1)
lib/lp/codehosting/tests/test_branchdistro.py (+7/-0)
To merge this branch: bzr merge lp:~thumper/launchpad/branch-distro-set-old-mature
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+36095@code.launchpad.net

Commit message

branch-distro.py now sets old branches as Mature.

Description of the change

Update the branch-distro script to set the old branches to Mature when creating the new ones.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

stuff

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2010-09-16 12:27:46 +0000
+++ database/schema/security.cfg 2010-09-21 23:12:48 +0000
@@ -628,7 +628,7 @@
628628
629[branch-distro]629[branch-distro]
630type=user630type=user
631public.branch = SELECT, INSERT631public.branch = SELECT, INSERT, UPDATE
632public.branchsubscription = SELECT, INSERT632public.branchsubscription = SELECT, INSERT
633public.distribution = SELECT633public.distribution = SELECT
634public.distroseries = SELECT634public.distroseries = SELECT
635635
=== modified file 'lib/lp/codehosting/branchdistro.py'
--- lib/lp/codehosting/branchdistro.py 2010-08-20 20:31:18 +0000
+++ lib/lp/codehosting/branchdistro.py 2010-09-21 23:12:48 +0000
@@ -28,7 +28,7 @@
2828
29from canonical.config import config29from canonical.config import config
30from canonical.launchpad.interfaces import ILaunchpadCelebrities30from canonical.launchpad.interfaces import ILaunchpadCelebrities
31from lp.code.enums import BranchType31from lp.code.enums import BranchLifecycleStatus, BranchType
32from lp.code.errors import BranchExists32from lp.code.errors import BranchExists
33from lp.code.interfaces.branchcollection import IAllBranches33from lp.code.interfaces.branchcollection import IAllBranches
34from lp.code.interfaces.branchnamespace import IBranchNamespaceSet34from lp.code.interfaces.branchnamespace import IBranchNamespaceSet
@@ -341,6 +341,7 @@
341 new_db_branch.sourcepackage.setBranch(341 new_db_branch.sourcepackage.setBranch(
342 PackagePublishingPocket.RELEASE, new_db_branch,342 PackagePublishingPocket.RELEASE, new_db_branch,
343 getUtility(ILaunchpadCelebrities).ubuntu_branches.teamowner)343 getUtility(ILaunchpadCelebrities).ubuntu_branches.teamowner)
344 old_db_branch.lifecycle_status = BranchLifecycleStatus.MATURE
344 # switch_branches *moves* the data to locations dependent on the345 # switch_branches *moves* the data to locations dependent on the
345 # new_branch's id, so if the transaction was rolled back we wouldn't346 # new_branch's id, so if the transaction was rolled back we wouldn't
346 # know the branch id and thus wouldn't be able to find the branch data347 # know the branch id and thus wouldn't be able to find the branch data
347348
=== modified file 'lib/lp/codehosting/tests/test_branchdistro.py'
--- lib/lp/codehosting/tests/test_branchdistro.py 2010-08-20 20:31:18 +0000
+++ lib/lp/codehosting/tests/test_branchdistro.py 2010-09-21 23:12:48 +0000
@@ -34,6 +34,7 @@
34 QuietFakeLogger,34 QuietFakeLogger,
35 )35 )
36from canonical.testing.layers import LaunchpadZopelessLayer36from canonical.testing.layers import LaunchpadZopelessLayer
37from lp.code.enums import BranchLifecycleStatus
37from lp.codehosting.branchdistro import (38from lp.codehosting.branchdistro import (
38 DistroBrancher,39 DistroBrancher,
39 switch_branches,40 switch_branches,
@@ -233,6 +234,12 @@
233 db_branch.sourcepackagename, brancher.new_distroseries.name],234 db_branch.sourcepackagename, brancher.new_distroseries.name],
234 [new_branch.owner, new_branch.distribution,235 [new_branch.owner, new_branch.distribution,
235 new_branch.sourcepackagename, new_branch.name])236 new_branch.sourcepackagename, new_branch.name])
237 # The new branch is set in the development state, and the old one is
238 # mature.
239 self.assertEqual(
240 BranchLifecycleStatus.DEVELOPMENT, new_branch.lifecycle_status)
241 self.assertEqual(
242 BranchLifecycleStatus.MATURE, db_branch.lifecycle_status)
236243
237 def test_makeOneNewBranch_inconsistent_branch(self):244 def test_makeOneNewBranch_inconsistent_branch(self):
238 # makeOneNewBranch skips over an inconsistent official package branch245 # makeOneNewBranch skips over an inconsistent official package branch