This is a nice improvement. Please change the zcml to require launchpad.Edit for requestUpgrade(). I just have one comment below.
merge-conditional
-Edwin
> === modified file 'lib/lp/code/model/tests/test_branch.py'
> --- lib/lp/code/model/tests/test_branch.py 2010-01-07 06:37:14 +0000
> +++ lib/lp/code/model/tests/test_branch.py 2010-01-19 22:00:02 +0000
> @@ -315,24 +315,33 @@
> SourcePackage(branch.sourcepackagename, branch.distroseries),
> branch.sourcepackage)
>
> + def test_needsUpgrading_already_requested(self):
> + # A branch has a needs_upgrading attribute that returns whether or
> not
> + # a branch needs to be upgraded or not. If the format is
> + # unrecognized, we don't try to upgrade it.
> + branch = self.factory.makePersonalBranch(
> + branch_format=BranchFormat.BZR_BRANCH_6,
> + repository_format=RepositoryFormat.BZR_CHK_2A)
> + branch.requestUpgrade()
> +
> + self.assertFalse(branch.needs_upgrading)
> +
> def test_needsUpgrading_branch_format_unrecognized(self):
> # A branch has a needs_upgrading attribute that returns whether or
> not
> # a branch needs to be upgraded or not. If the format is
> # unrecognized, we don't try to upgrade it.
> branch = self.factory.makePersonalBranch(
> - branch_format=BranchFormat.UNRECOGNIZED)
> + branch_format=BranchFormat.UNRECOGNIZED,
> + repository_format=RepositoryFormat.BZR_CHK_2A)
> self.assertFalse(branch.needs_upgrading)
>
> def test_needsUpgrading_branch_format_upgrade_not_needed(self):
> # A branch has a needs_upgrading attribute that returns whether or
> not
> # a branch needs to be upgraded or not. If a branch is up to date,
> it
Hi Paul,
This is a nice improvement. Please change the zcml to require launchpad.Edit for requestUpgrade(). I just have one comment below.
merge-conditional
-Edwin
> === modified file 'lib/lp/ code/model/ tests/test_ branch. py' code/model/ tests/test_ branch. py 2010-01-07 06:37:14 +0000 code/model/ tests/test_ branch. py 2010-01-19 22:00:02 +0000 branch. sourcepackagena me, branch. distroseries) , sourcepackage) ding_already_ requested( self): makePersonalBra nch( format= BranchFormat. BZR_BRANCH_ 6, format= RepositoryForma t.BZR_CHK_ 2A) requestUpgrade( ) e(branch. needs_upgrading ) ding_branch_ format_ unrecognized( self): makePersonalBra nch( format= BranchFormat. UNRECOGNIZED) format= BranchFormat. UNRECOGNIZED, format= RepositoryForma t.BZR_CHK_ 2A) e(branch. needs_upgrading ) ding_branch_ format_ upgrade_ not_needed( self):
> --- lib/lp/
> +++ lib/lp/
> @@ -315,24 +315,33 @@
> SourcePackage(
> branch.
>
> + def test_needsUpgra
> + # A branch has a needs_upgrading attribute that returns whether or
> not
> + # a branch needs to be upgraded or not. If the format is
> + # unrecognized, we don't try to upgrade it.
> + branch = self.factory.
> + branch_
> + repository_
> + branch.
> +
> + self.assertFals
> +
> def test_needsUpgra
> # A branch has a needs_upgrading attribute that returns whether or
> not
> # a branch needs to be upgraded or not. If the format is
> # unrecognized, we don't try to upgrade it.
> branch = self.factory.
> - branch_
> + branch_
> + repository_
> self.assertFals
>
> def test_needsUpgra
> # A branch has a needs_upgrading attribute that returns whether or
> not
> # a branch needs to be upgraded or not. If a branch is up to date,
> it
s/up to date/up-to-date/