Merge lp:~jelmer/bzr-loom/branch5-move into lp:bzr-loom

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Martin Packman
Approved revision: 158
Merged at revision: 160
Proposed branch: lp:~jelmer/bzr-loom/branch5-move
Merge into: lp:bzr-loom
Diff against target: 52 lines (+10/-4)
1 file modified
branch.py (+10/-4)
To merge this branch: bzr merge lp:~jelmer/bzr-loom/branch5-move
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Review via email: mp+115302@code.launchpad.net

Description of the change

Cope with the move of BzrBranch5 in upstream bzr.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

I'd generally stick a comment by the try/import/except saying which versions this matters for. Change looks good otherwise.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'branch.py'
2--- branch.py 2012-03-16 17:15:22 +0000
3+++ branch.py 2012-07-17 09:07:23 +0000
4@@ -54,6 +54,12 @@
5 EMPTY_REVISION = 'empty:'
6
7
8+try:
9+ from bzrlib.branchfmt.fullhistory import BzrBranch5, BzrBranchFormat5
10+except ImportError:
11+ from bzrlib.branch import BzrBranch5, BzrBranchFormat5
12+
13+
14 def create_thread(loom, thread_name):
15 """Create a thread in the branch loom called thread."""
16 require_loom_branch(loom)
17@@ -89,7 +95,7 @@
18 raise AlreadyLoom(branch)
19 try:
20 format = {
21- bzrlib.branch.BzrBranchFormat5: BzrBranchLoomFormat1,
22+ BzrBranchFormat5: BzrBranchLoomFormat1,
23 bzrlib.branch.BzrBranchFormat6: BzrBranchLoomFormat6,
24 bzrlib.branch.BzrBranchFormat7: BzrBranchLoomFormat7,
25 }[branch._format.__class__]()
26@@ -742,7 +748,7 @@
27 return bzrlib.branch.Branch.hooks['post_push']
28
29
30-class LoomBranch(LoomSupport, bzrlib.branch.BzrBranch5):
31+class LoomBranch(LoomSupport, BzrBranch5):
32 """The Loom branch.
33
34 A mixin is used as the easiest migration path to support branch6. A
35@@ -842,7 +848,7 @@
36
37
38
39-class BzrBranchLoomFormat1(LoomFormatMixin, bzrlib.branch.BzrBranchFormat5):
40+class BzrBranchLoomFormat1(LoomFormatMixin, BzrBranchFormat5):
41 """Loom's first format.
42
43 This format is an extension to BzrBranchFormat5 with the following changes:
44@@ -857,7 +863,7 @@
45 def _branch_class(self):
46 return LoomBranch
47
48- _parent_classs = bzrlib.branch.BzrBranchFormat5
49+ _parent_classs = BzrBranchFormat5
50
51 @classmethod
52 def get_format_string(cls):

Subscribers

People subscribed via source and target branches