@@ -277,7 +277,7 @@ def export_branch(repo, name):
277
277
ref = '%s/heads/%s' % (prefix , name )
278
278
tip = marks .get_tip (name )
279
279
280
- branch = branches [name ]
280
+ branch = bzrlib . branch . Branch . open ( branches [name ])
281
281
repo = branch .repository
282
282
283
283
branch .lock_read ()
@@ -582,7 +582,7 @@ def parse_commit(parser):
582
582
583
583
if ref .startswith ('refs/heads/' ):
584
584
name = ref [len ('refs/heads/' ):]
585
- branch = branches [name ]
585
+ branch = bzrlib . branch . Branch . open ( branches [name ])
586
586
else :
587
587
die ('unknown ref' )
588
588
@@ -683,7 +683,7 @@ def do_export(parser):
683
683
684
684
for ref , revid in parsed_refs .iteritems ():
685
685
name = ref [len ('refs/heads/' ):]
686
- branch = branches [name ]
686
+ branch = bzrlib . branch . Branch . open ( branches [name ])
687
687
branch .generate_revision_history (revid , marks .get_tip (name ))
688
688
689
689
if name in peers :
@@ -733,7 +733,7 @@ def do_list(parser):
733
733
master_branch = name
734
734
print "? refs/heads/%s" % name
735
735
736
- branch = branches [master_branch ]
736
+ branch = bzrlib . branch . Branch . open ( branches [master_branch ])
737
737
branch .lock_read ()
738
738
for tag , revid in branch .tags .get_tag_dict ().items ():
739
739
try :
@@ -822,13 +822,15 @@ def get_repo(url, alias):
822
822
# branch
823
823
824
824
name = 'master'
825
- branch = origin .open_branch ()
825
+ remote_branch = origin .open_branch ()
826
826
827
827
if not is_local :
828
- peers [name ] = branch .base
829
- branches [ name ] = get_remote_branch (origin , branch , name )
828
+ peers [name ] = remote_branch .base
829
+ branch = get_remote_branch (origin , remote_branch , name )
830
830
else :
831
- branches [name ] = branch
831
+ branch = remote_branch
832
+
833
+ branches [name ] = branch .base
832
834
833
835
return branch .repository
834
836
else :
@@ -838,13 +840,15 @@ def get_repo(url, alias):
838
840
# stupid python
839
841
wanted = [e for e in wanted if e ]
840
842
841
- for name , branch in find_branches (repo , wanted ):
843
+ for name , remote_branch in find_branches (repo , wanted ):
842
844
843
845
if not is_local :
844
- peers [name ] = branch .base
845
- branches [ name ] = get_remote_branch (origin , branch , name )
846
+ peers [name ] = remote_branch .base
847
+ branch = get_remote_branch (origin , remote_branch , name )
846
848
else :
847
- branches [name ] = branch
849
+ branch = remote_branch
850
+
851
+ branches [name ] = branch .base
848
852
849
853
return repo
850
854
0 commit comments