Skip to content

Commit 38e7167

Browse files
Felipe Contrerasgitster
authored andcommitted
remote-bzr: fixes for branch diverge
If the branches diverge we want to reset the pointer to where the remote actually is. Since we can access remote branches just as easily as local ones, let's do so. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f38dfc4 commit 38e7167

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

contrib/remote-helpers/git-remote-bzr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ def do_import(parser):
354354
if os.path.exists(path):
355355
print "feature import-marks=%s" % path
356356
print "feature export-marks=%s" % path
357+
print "feature force"
357358
sys.stdout.flush()
358359

359360
while parser.check('import'):
@@ -716,7 +717,12 @@ def get_repo(url, alias):
716717
# pull
717718
d = bzrlib.bzrdir.BzrDir.open(clone_path)
718719
branch = d.open_branch()
719-
result = branch.pull(remote_branch, [], None, False)
720+
try:
721+
result = branch.pull(remote_branch, [], None, False)
722+
except bzrlib.errors.DivergedBranches:
723+
# use remote branch for now
724+
peer = None
725+
return remote_branch
720726
else:
721727
# clone
722728
d = origin.sprout(clone_path, None,

0 commit comments

Comments
 (0)