Merge lp:~abentley/launchpad/unnecessary-upgrade into lp:launchpad

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 13765
Proposed branch: lp:~abentley/launchpad/unnecessary-upgrade
Merge into: lp:launchpad
Prerequisite: lp:~abentley/launchpad/upgrade-not-branch-error
Diff against target: 416 lines (+151/-23)
8 files modified
lib/lp/code/browser/branch.py (+5/-1)
lib/lp/code/browser/tests/test_branch.py (+26/-4)
lib/lp/code/errors.py (+34/-0)
lib/lp/code/interfaces/branch.py (+6/-0)
lib/lp/code/model/branch.py (+20/-7)
lib/lp/code/model/branchjob.py (+1/-4)
lib/lp/code/model/tests/test_branch.py (+52/-4)
lib/lp/code/model/tests/test_branchjob.py (+7/-3)
To merge this branch: bzr merge lp:~abentley/launchpad/unnecessary-upgrade
Reviewer Review Type Date Requested Status
Deryck Hodge (community) code Approve
Review via email: mp+72480@code.launchpad.net

Commit message

Nice error if branch cannot be upgraded.

Description of the change

= Summary =
Fix bug #823850: AssertionError raised upgrading a branch that doesn't need upgrade

== Proposed fix ==
Produce a notification explaining why the branch could not be upgraded.

== Pre-implementation notes ==
None

== Implementation details ==
Extracted the Branch.needs_upgrade logic to Branch.checkUpgrade, so that we can raise exceptions based on the precise checks.

Fixed lint.

== Tests ==
bin/test -t checkUpgrade -t test_upgrade_branch_action_cannot_upgrade

== Demo and Q/A ==
Upgrade a branch, and then immediately request another upgrade. You should get a nice error notification.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/code/errors.py
  lib/lp/code/browser/branch.py
  lib/lp/code/browser/tests/test_branch.py
  lib/lp/code/interfaces/branch.py
  lib/lp/code/model/branch.py
  lib/lp/code/model/branchjob.py
  lib/lp/code/model/tests/test_branch.py

To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

Looks good. Thanks for fixing this!

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/branch.py'
--- lib/lp/code/browser/branch.py 2011-08-22 18:45:27 +0000
+++ lib/lp/code/browser/branch.py 2011-08-22 18:45:28 +0000
@@ -131,6 +131,7 @@
131from lp.code.errors import (131from lp.code.errors import (
132 BranchCreationForbidden,132 BranchCreationForbidden,
133 BranchExists,133 BranchExists,
134 CannotUpgradeBranch,
134 CodeImportAlreadyRequested,135 CodeImportAlreadyRequested,
135 CodeImportAlreadyRunning,136 CodeImportAlreadyRunning,
136 CodeImportNotInReviewedState,137 CodeImportNotInReviewedState,
@@ -993,7 +994,10 @@
993994
994 @action('Upgrade', name='upgrade_branch')995 @action('Upgrade', name='upgrade_branch')
995 def upgrade_branch_action(self, action, data):996 def upgrade_branch_action(self, action, data):
996 self.context.requestUpgrade(self.user)997 try:
998 self.context.requestUpgrade(self.user)
999 except CannotUpgradeBranch as e:
1000 self.request.response.addErrorNotification(e)
9971001
9981002
999class BranchEditView(BranchEditFormView, BranchNameValidationMixin):1003class BranchEditView(BranchEditFormView, BranchNameValidationMixin):
10001004
=== modified file 'lib/lp/code/browser/tests/test_branch.py'
--- lib/lp/code/browser/tests/test_branch.py 2011-07-21 02:18:54 +0000
+++ lib/lp/code/browser/tests/test_branch.py 2011-08-22 18:45:28 +0000
@@ -7,12 +7,10 @@
77
8from datetime import (8from datetime import (
9 datetime,9 datetime,
10 timedelta,
11 )10 )
12from textwrap import dedent11from textwrap import dedent
1312
14import pytz13import pytz
15import simplejson
16from zope.security.proxy import removeSecurityProxy14from zope.security.proxy import removeSecurityProxy
1715
18from canonical.config import config16from canonical.config import config
@@ -41,7 +39,11 @@
41 BranchView,39 BranchView,
42 )40 )
43from lp.code.browser.branchlisting import PersonOwnedBranchesView41from lp.code.browser.branchlisting import PersonOwnedBranchesView
44from lp.code.bzr import ControlFormat42from lp.code.bzr import (
43 BranchFormat,
44 ControlFormat,
45 RepositoryFormat,
46 )
45from lp.code.enums import (47from lp.code.enums import (
46 BranchLifecycleStatus,48 BranchLifecycleStatus,
47 BranchType,49 BranchType,
@@ -400,7 +402,7 @@
400402
401 def _add_revisions(self, branch, nr_revisions=1):403 def _add_revisions(self, branch, nr_revisions=1):
402 revisions = []404 revisions = []
403 for seq in range(1, nr_revisions+1):405 for seq in range(1, nr_revisions + 1):
404 revision = self.factory.makeRevision(406 revision = self.factory.makeRevision(
405 author="Eric the Viking <eric@vikings-r-us.example.com>",407 author="Eric the Viking <eric@vikings-r-us.example.com>",
406 log_body=(408 log_body=(
@@ -806,3 +808,23 @@
806 'Some Product.'))808 'Some Product.'))
807 with person_logged_in(person):809 with person_logged_in(person):
808 self.assertEquals(person, branch.owner)810 self.assertEquals(person, branch.owner)
811
812
813class TestBranchUpgradeView(TestCaseWithFactory):
814
815 layer = LaunchpadFunctionalLayer
816
817 def test_upgrade_branch_action_cannot_upgrade(self):
818 # A nice error is displayed if a branch cannot be upgraded.
819 branch = self.factory.makePersonalBranch(
820 branch_format=BranchFormat.BZR_BRANCH_6,
821 repository_format=RepositoryFormat.BZR_CHK_2A)
822 login_person(branch.owner)
823 self.addCleanup(logout)
824 branch.requestUpgrade(branch.owner)
825 view = create_initialized_view(branch, '+upgrade')
826 view.upgrade_branch_action.success({})
827 self.assertEqual(1, len(view.request.notifications))
828 self.assertEqual(
829 'An upgrade is already in progress for branch %s.' %
830 branch.bzr_identity, view.request.notifications[0].message)
809831
=== modified file 'lib/lp/code/errors.py'
--- lib/lp/code/errors.py 2011-06-23 21:09:20 +0000
+++ lib/lp/code/errors.py 2011-08-22 18:45:28 +0000
@@ -5,6 +5,7 @@
55
6__metaclass__ = type6__metaclass__ = type
7__all__ = [7__all__ = [
8 'AlreadyLatestFormat',
8 'BadBranchMergeProposalSearchContext',9 'BadBranchMergeProposalSearchContext',
9 'BadStateTransition',10 'BadStateTransition',
10 'BranchCannotBePrivate',11 'BranchCannotBePrivate',
@@ -20,6 +21,8 @@
20 'BuildNotAllowedForDistro',21 'BuildNotAllowedForDistro',
21 'BranchMergeProposalExists',22 'BranchMergeProposalExists',
22 'CannotDeleteBranch',23 'CannotDeleteBranch',
24 'CannotUpgradeBranch',
25 'CannotUpgradeNonHosted',
23 'CannotHaveLinkedBranch',26 'CannotHaveLinkedBranch',
24 'CodeImportAlreadyRequested',27 'CodeImportAlreadyRequested',
25 'CodeImportAlreadyRunning',28 'CodeImportAlreadyRunning',
@@ -36,6 +39,7 @@
36 'TooManyBuilds',39 'TooManyBuilds',
37 'TooNewRecipeFormat',40 'TooNewRecipeFormat',
38 'UnknownBranchTypeError',41 'UnknownBranchTypeError',
42 'UpgradePending',
39 'UserHasExistingReview',43 'UserHasExistingReview',
40 'UserNotBranchReviewer',44 'UserNotBranchReviewer',
41 'WrongBranchMergeProposal',45 'WrongBranchMergeProposal',
@@ -167,6 +171,36 @@
167 _msg_template = "%s cannot have linked branches."171 _msg_template = "%s cannot have linked branches."
168172
169173
174class CannotUpgradeBranch(Exception):
175 """"Made for subclassing."""
176
177 def __init__(self, branch):
178 super(CannotUpgradeBranch, self).__init__(
179 self._msg_template % branch.bzr_identity)
180 self.branch = branch
181
182
183class AlreadyLatestFormat(CannotUpgradeBranch):
184 """Raised on attempt to upgrade a branch already in the latest format."""
185
186 _msg_template = (
187 'Branch %s is in the latest format, so it cannot be upgraded.')
188
189
190class CannotUpgradeNonHosted(CannotUpgradeBranch):
191
192 """Raised on attempt to upgrade a non-Hosted branch."""
193
194 _msg_template = 'Cannot upgrade non-hosted branch %s'
195
196
197class UpgradePending(CannotUpgradeBranch):
198
199 """Raised on attempt to upgrade a branch already in the latest format."""
200
201 _msg_template = 'An upgrade is already in progress for branch %s.'
202
203
170class ClaimReviewFailed(Exception):204class ClaimReviewFailed(Exception):
171 """The user cannot claim the pending review."""205 """The user cannot claim the pending review."""
172206
173207
=== modified file 'lib/lp/code/interfaces/branch.py'
--- lib/lp/code/interfaces/branch.py 2011-08-22 18:45:27 +0000
+++ lib/lp/code/interfaces/branch.py 2011-08-22 18:45:28 +0000
@@ -944,6 +944,12 @@
944 :return: A list of tuples like (date, count).944 :return: A list of tuples like (date, count).
945 """945 """
946946
947 def checkUpgrade():
948 """Check whether an upgrade should be performed, and raise if not.
949
950 :raises: a `CannotUpgradeBranch`, or a subclass.
951 """
952
947 needs_upgrading = Attribute("Whether the branch needs to be upgraded.")953 needs_upgrading = Attribute("Whether the branch needs to be upgraded.")
948 upgrade_pending = Attribute(954 upgrade_pending = Attribute(
949 "Whether a branch has had an upgrade requested.")955 "Whether a branch has had an upgrade requested.")
950956
=== modified file 'lib/lp/code/model/branch.py'
--- lib/lp/code/model/branch.py 2011-08-22 18:45:27 +0000
+++ lib/lp/code/model/branch.py 2011-08-22 18:45:28 +0000
@@ -87,14 +87,18 @@
87 BranchType,87 BranchType,
88 )88 )
89from lp.code.errors import (89from lp.code.errors import (
90 AlreadyLatestFormat,
90 BranchCannotBePrivate,91 BranchCannotBePrivate,
91 BranchCannotBePublic,92 BranchCannotBePublic,
92 BranchMergeProposalExists,93 BranchMergeProposalExists,
93 BranchTargetError,94 BranchTargetError,
94 BranchTypeError,95 BranchTypeError,
95 CannotDeleteBranch,96 CannotDeleteBranch,
97 CannotUpgradeBranch,
98 CannotUpgradeNonHosted,
96 InvalidBranchMergeProposal,99 InvalidBranchMergeProposal,
97 InvalidMergeQueueConfig,100 InvalidMergeQueueConfig,
101 UpgradePending,
98 )102 )
99from lp.code.event.branchmergeproposal import (103from lp.code.event.branchmergeproposal import (
100 BranchMergeProposalNeedsReviewEvent,104 BranchMergeProposalNeedsReviewEvent,
@@ -1127,16 +1131,25 @@
1127 DateTrunc(u'day', Revision.revision_date))1131 DateTrunc(u'day', Revision.revision_date))
1128 return sorted(results)1132 return sorted(results)
11291133
1130 @property1134 def checkUpgrade(self):
1131 def needs_upgrading(self):
1132 """See `IBranch`."""
1133 if self.branch_type is not BranchType.HOSTED:1135 if self.branch_type is not BranchType.HOSTED:
1134 return False1136 raise CannotUpgradeNonHosted(self)
1135 if self.upgrade_pending:1137 if self.upgrade_pending:
1136 return False1138 raise UpgradePending(self)
1137 return not (1139 if (
1138 self.branch_format in CURRENT_BRANCH_FORMATS and1140 self.branch_format in CURRENT_BRANCH_FORMATS and
1139 self.repository_format in CURRENT_REPOSITORY_FORMATS)1141 self.repository_format in CURRENT_REPOSITORY_FORMATS):
1142 raise AlreadyLatestFormat(self)
1143
1144 @property
1145 def needs_upgrading(self):
1146 """See `IBranch`."""
1147 try:
1148 self.checkUpgrade()
1149 except CannotUpgradeBranch:
1150 return False
1151 else:
1152 return True
11401153
1141 @property1154 @property
1142 def upgrade_pending(self):1155 def upgrade_pending(self):
11431156
=== modified file 'lib/lp/code/model/branchjob.py'
--- lib/lp/code/model/branchjob.py 2011-08-22 18:45:27 +0000
+++ lib/lp/code/model/branchjob.py 2011-08-22 18:45:28 +0000
@@ -378,10 +378,7 @@
378 @classmethod378 @classmethod
379 def create(cls, branch, requester):379 def create(cls, branch, requester):
380 """See `IBranchUpgradeJobSource`."""380 """See `IBranchUpgradeJobSource`."""
381 if not branch.needs_upgrading:381 branch.checkUpgrade()
382 raise AssertionError('Branch does not need upgrading.')
383 if branch.upgrade_pending:
384 raise AssertionError('Branch already has upgrade pending.')
385 branch_job = BranchJob(382 branch_job = BranchJob(
386 branch, BranchJobType.UPGRADE_BRANCH, {}, requester=requester)383 branch, BranchJobType.UPGRADE_BRANCH, {}, requester=requester)
387 return cls(branch_job)384 return cls(branch_job)
388385
=== modified file 'lib/lp/code/model/tests/test_branch.py'
--- lib/lp/code/model/tests/test_branch.py 2011-08-22 18:45:27 +0000
+++ lib/lp/code/model/tests/test_branch.py 2011-08-22 18:45:28 +0000
@@ -19,6 +19,7 @@
19import simplejson19import simplejson
20from sqlobject import SQLObjectNotFound20from sqlobject import SQLObjectNotFound
21from storm.locals import Store21from storm.locals import Store
22from testtools import ExpectedException
22import transaction23import transaction
23from zope.component import getUtility24from zope.component import getUtility
24from zope.security.proxy import removeSecurityProxy25from zope.security.proxy import removeSecurityProxy
@@ -56,14 +57,17 @@
56 CodeReviewNotificationLevel,57 CodeReviewNotificationLevel,
57 )58 )
58from lp.code.errors import (59from lp.code.errors import (
60 AlreadyLatestFormat,
59 BranchCannotBePrivate,61 BranchCannotBePrivate,
60 BranchCannotBePublic,62 BranchCannotBePublic,
61 BranchCreatorNotMemberOfOwnerTeam,63 BranchCreatorNotMemberOfOwnerTeam,
62 BranchCreatorNotOwner,64 BranchCreatorNotOwner,
63 BranchTargetError,65 BranchTargetError,
64 CannotDeleteBranch,66 CannotDeleteBranch,
67 CannotUpgradeNonHosted,
65 InvalidBranchMergeProposal,68 InvalidBranchMergeProposal,
66 InvalidMergeQueueConfig,69 InvalidMergeQueueConfig,
70 UpgradePending,
67 )71 )
68from lp.code.interfaces.branch import (72from lp.code.interfaces.branch import (
69 DEFAULT_BRANCH_STATUS_IN_LISTING,73 DEFAULT_BRANCH_STATUS_IN_LISTING,
@@ -586,6 +590,14 @@
586 branch = self.factory.makePersonalBranch()590 branch = self.factory.makePersonalBranch()
587 self.assertFalse(branch.needs_upgrading)591 self.assertFalse(branch.needs_upgrading)
588592
593 def test_checkUpgrade_empty_formats(self):
594 branch = self.factory.makePersonalBranch()
595 with ExpectedException(
596 AlreadyLatestFormat,
597 'Branch lp://dev/~person-name.*junk/branch.* is in the latest'
598 ' format, so it cannot be upgraded.'):
599 branch.checkUpgrade()
600
589 def test_needsUpgrade_mirrored_branch(self):601 def test_needsUpgrade_mirrored_branch(self):
590 branch = self.factory.makeBranch(602 branch = self.factory.makeBranch(
591 branch_type=BranchType.MIRRORED,603 branch_type=BranchType.MIRRORED,
@@ -593,6 +605,16 @@
593 repository_format=RepositoryFormat.BZR_REPOSITORY_4)605 repository_format=RepositoryFormat.BZR_REPOSITORY_4)
594 self.assertFalse(branch.needs_upgrading)606 self.assertFalse(branch.needs_upgrading)
595607
608 def test_checkUpgrade_mirrored_branch(self):
609 branch = self.factory.makeBranch(
610 branch_type=BranchType.MIRRORED,
611 branch_format=BranchFormat.BZR_BRANCH_6,
612 repository_format=RepositoryFormat.BZR_REPOSITORY_4)
613 with ExpectedException(
614 CannotUpgradeNonHosted,
615 'Cannot upgrade non-hosted branch %s' % branch.bzr_identity):
616 branch.checkUpgrade()
617
596 def test_needsUpgrade_remote_branch(self):618 def test_needsUpgrade_remote_branch(self):
597 branch = self.factory.makeBranch(619 branch = self.factory.makeBranch(
598 branch_type=BranchType.REMOTE,620 branch_type=BranchType.REMOTE,
@@ -621,6 +643,20 @@
621643
622 self.assertFalse(branch.needs_upgrading)644 self.assertFalse(branch.needs_upgrading)
623645
646 def test_checkUpgrade_already_requested(self):
647 branch = self.factory.makePersonalBranch(
648 branch_format=BranchFormat.BZR_BRANCH_6,
649 repository_format=RepositoryFormat.BZR_CHK_2A)
650 owner = removeSecurityProxy(branch).owner
651 login_person(owner)
652 self.addCleanup(logout)
653 branch.requestUpgrade(branch.owner)
654 with ExpectedException(
655 UpgradePending,
656 'An upgrade is already in progress for branch'
657 ' lp://dev/~person-name.*junk/branch.*.'):
658 branch.checkUpgrade()
659
624 def test_needsUpgrading_branch_format_unrecognized(self):660 def test_needsUpgrading_branch_format_unrecognized(self):
625 # A branch has a needs_upgrading attribute that returns whether or not661 # A branch has a needs_upgrading attribute that returns whether or not
626 # a branch needs to be upgraded or not. If the format is662 # a branch needs to be upgraded or not. If the format is
@@ -639,6 +675,17 @@
639 repository_format=RepositoryFormat.BZR_CHK_2A)675 repository_format=RepositoryFormat.BZR_CHK_2A)
640 self.assertFalse(branch.needs_upgrading)676 self.assertFalse(branch.needs_upgrading)
641677
678 def test_checkUpgrade_branch_format_upgrade_not_needed(self):
679 # If a branch is up-to-date, checkUpgrade raises AlreadyLatestFormat
680 branch = self.factory.makePersonalBranch(
681 branch_format=BranchFormat.BZR_BRANCH_8,
682 repository_format=RepositoryFormat.BZR_CHK_2A)
683 with ExpectedException(
684 AlreadyLatestFormat,
685 'Branch lp://dev/~person-name.*junk/branch.* is in the latest'
686 ' format, so it cannot be upgraded.'):
687 branch.checkUpgrade()
688
642 def test_needsUpgrading_branch_format_upgrade_needed(self):689 def test_needsUpgrading_branch_format_upgrade_needed(self):
643 # A branch has a needs_upgrading attribute that returns whether or not690 # A branch has a needs_upgrading attribute that returns whether or not
644 # a branch needs to be upgraded or not. If a branch doesn't support691 # a branch needs to be upgraded or not. If a branch doesn't support
@@ -691,18 +738,19 @@
691738
692 def test_requestUpgrade_no_upgrade_needed(self):739 def test_requestUpgrade_no_upgrade_needed(self):
693 # If a branch doesn't need to be upgraded, requestUpgrade raises an740 # If a branch doesn't need to be upgraded, requestUpgrade raises an
694 # AssertionError.741 # AlreadyLatestFormat.
695 branch = self.factory.makeAnyBranch(742 branch = self.factory.makeAnyBranch(
696 branch_format=BranchFormat.BZR_BRANCH_8,743 branch_format=BranchFormat.BZR_BRANCH_8,
697 repository_format=RepositoryFormat.BZR_CHK_2A)744 repository_format=RepositoryFormat.BZR_CHK_2A)
698 owner = removeSecurityProxy(branch).owner745 owner = removeSecurityProxy(branch).owner
699 login_person(owner)746 login_person(owner)
700 self.addCleanup(logout)747 self.addCleanup(logout)
701 self.assertRaises(AssertionError, branch.requestUpgrade, branch.owner)748 self.assertRaises(
749 AlreadyLatestFormat, branch.requestUpgrade, branch.owner)
702750
703 def test_requestUpgrade_upgrade_pending(self):751 def test_requestUpgrade_upgrade_pending(self):
704 # If there is a pending upgrade already requested, requestUpgrade752 # If there is a pending upgrade already requested, requestUpgrade
705 # raises an AssertionError.753 # raises an UpgradePending.
706 branch = self.factory.makeAnyBranch(754 branch = self.factory.makeAnyBranch(
707 branch_format=BranchFormat.BZR_BRANCH_6)755 branch_format=BranchFormat.BZR_BRANCH_6)
708 owner = removeSecurityProxy(branch).owner756 owner = removeSecurityProxy(branch).owner
@@ -710,7 +758,7 @@
710 self.addCleanup(logout)758 self.addCleanup(logout)
711 branch.requestUpgrade(branch.owner)759 branch.requestUpgrade(branch.owner)
712760
713 self.assertRaises(AssertionError, branch.requestUpgrade, branch.owner)761 self.assertRaises(UpgradePending, branch.requestUpgrade, branch.owner)
714762
715 def test_upgradePending(self):763 def test_upgradePending(self):
716 # If there is a BranchUpgradeJob pending for the branch, return True.764 # If there is a BranchUpgradeJob pending for the branch, return True.
717765
=== modified file 'lib/lp/code/model/tests/test_branchjob.py'
--- lib/lp/code/model/tests/test_branchjob.py 2011-08-22 18:45:27 +0000
+++ lib/lp/code/model/tests/test_branchjob.py 2011-08-22 18:45:28 +0000
@@ -52,6 +52,7 @@
52 BranchSubscriptionNotificationLevel,52 BranchSubscriptionNotificationLevel,
53 CodeReviewNotificationLevel,53 CodeReviewNotificationLevel,
54 )54 )
55from lp.code.errors import AlreadyLatestFormat
55from lp.code.interfaces.branchjob import (56from lp.code.interfaces.branchjob import (
56 IBranchDiffJob,57 IBranchDiffJob,
57 IBranchJob,58 IBranchJob,
@@ -307,6 +308,8 @@
307 'Bazaar-NG Knit Repository Format 1')308 'Bazaar-NG Knit Repository Format 1')
308309
309 job = BranchUpgradeJob.create(db_branch, self.factory.makePerson())310 job = BranchUpgradeJob.create(db_branch, self.factory.makePerson())
311
312 dbuser = config.launchpad.dbuser
310 self.becomeDbUser(config.upgrade_branches.dbuser)313 self.becomeDbUser(config.upgrade_branches.dbuser)
311 with TransactionFreeOperation.require():314 with TransactionFreeOperation.require():
312 job.run()315 job.run()
@@ -315,16 +318,17 @@
315 new_branch.repository._format.get_format_string(),318 new_branch.repository._format.get_format_string(),
316 'Bazaar repository format 2a (needs bzr 1.16 or later)\n')319 'Bazaar repository format 2a (needs bzr 1.16 or later)\n')
317320
321 self.becomeDbUser(dbuser)
318 self.assertFalse(db_branch.needs_upgrading)322 self.assertFalse(db_branch.needs_upgrading)
319323
320 def test_needs_no_upgrading(self):324 def test_needs_no_upgrading(self):
321 # Branch upgrade job creation should raise an AssertionError if the325 # Branch upgrade job creation should raise an AlreadyLatestFormat if
322 # branch does not need to be upgraded.326 # the branch does not need to be upgraded.
323 branch = self.factory.makeAnyBranch(327 branch = self.factory.makeAnyBranch(
324 branch_format=BranchFormat.BZR_BRANCH_7,328 branch_format=BranchFormat.BZR_BRANCH_7,
325 repository_format=RepositoryFormat.BZR_CHK_2A)329 repository_format=RepositoryFormat.BZR_CHK_2A)
326 self.assertRaises(330 self.assertRaises(
327 AssertionError, BranchUpgradeJob.create, branch,331 AlreadyLatestFormat, BranchUpgradeJob.create, branch,
328 self.factory.makePerson())332 self.factory.makePerson())
329333
330 def create_knit(self):334 def create_knit(self):