Merge lp:~rockstar/launchpad/upgrade-job-2.0-changes into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Edwin Grubbs on 2010-01-20 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | not available |
| Proposed branch: | lp:~rockstar/launchpad/upgrade-job-2.0-changes |
| Merge into: | lp:launchpad |
| Diff against target: |
425 lines (+209/-14) 11 files modified
lib/lp/code/browser/branch.py (+31/-1) lib/lp/code/browser/configure.zcml (+7/-0) lib/lp/code/bzr.py (+32/-0) lib/lp/code/configure.zcml (+1/-0) lib/lp/code/interfaces/branch.py (+2/-0) lib/lp/code/model/branch.py (+18/-5) lib/lp/code/model/branchjob.py (+2/-0) lib/lp/code/model/tests/test_branch.py (+51/-7) lib/lp/code/stories/branches/xx-upgrading-branches.txt (+49/-0) lib/lp/code/templates/branch-messages.pt (+6/-0) lib/lp/code/templates/branch-metadata.pt (+10/-1) |
| To merge this branch: | bzr merge lp:~rockstar/launchpad/upgrade-job-2.0-changes |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Edwin Grubbs (community) | code | 2010-01-20 | Approve on 2010-01-20 |
|
Review via email:
|
|||
| Paul Hummer (rockstar) wrote : | # |
| Paul Hummer (rockstar) wrote : | # |
Hrm, this diff seems confused. It has this branch's changes as well as the next branch's changes... Here's the real diff:
=== modified file 'lib/lp/
--- lib/lp/code/bzr.py 2009-06-30 16:56:07 +0000
+++ lib/lp/code/bzr.py 2010-01-16 07:38:47 +0000
@@ -8,6 +8,8 @@
'BranchFor
'BRANCH_
'ControlFo
+ 'CURRENT_
+ 'CURRENT_
'Repositor
'REPOSITOR
]
@@ -222,6 +224,36 @@
BZR_METADIR_1 = _format_enum(1, BzrDirMetaFormat1)
+# A tuple of branch formats that should not suggest upgrading.
+CURRENT_
+ BranchFormat.
+ BranchFormat.
+ BranchFormat.
+ BranchFormat.
+ BranchFormat.
+ BranchFormat.
+)
+
+# A tuple of repository formats that should not suggest upgrading.
+CURRENT_
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+ RepositoryForma
+
+)
+
BRANCH_
BranchForm
BranchForm
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -487,6 +487,7 @@
+ upgrade_pending
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -1057,6 +1057,8 @@
"""
needs_
+ upgrade_pending = Attribute(
+ "Whether a branch has had an upgrade requested.")
def requestUpgrade():
"""Create an IBranchUpgradeJob to upgrade this branch."""
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -42,7 +42,8 @@
IStoreSele
from lp.code.bzr import (
- BranchFormat, BRANCH_
+ BranchFormat, BRANCH_
+ CURRENT_
REPOSITORY
from lp.code.enums import (
BranchLife
@@ -991,10 +992,22 @@
@property
...
| Edwin Grubbs (edwin-grubbs) wrote : | # |
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/
> --- 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/

Hi there-
This branch makes some changes to the branch upgrade structure and the way a
branch determines whether or not it needs to be upgraded. Most of the original
code was pre-2.0, and now that bzr 2.0 has been released, the formats are a
little more stable, and we won't need to be concerned too much about changing
formats anymore.
Instead of saying X format needs to be upgraded to Y format, we can just
upgrade it and it'll go to the 2.0 format regardless of the original format (as
opposed to the potential downgrade of older bzr).
Cheers,
Paul