提交 38e7167e 编写于 作者: F Felipe Contreras 提交者: Junio C Hamano

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: NFelipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 f38dfc4c
......@@ -354,6 +354,7 @@ def do_import(parser):
if os.path.exists(path):
print "feature import-marks=%s" % path
print "feature export-marks=%s" % path
print "feature force"
sys.stdout.flush()
while parser.check('import'):
......@@ -716,7 +717,12 @@ def get_repo(url, alias):
# pull
d = bzrlib.bzrdir.BzrDir.open(clone_path)
branch = d.open_branch()
result = branch.pull(remote_branch, [], None, False)
try:
result = branch.pull(remote_branch, [], None, False)
except bzrlib.errors.DivergedBranches:
# use remote branch for now
peer = None
return remote_branch
else:
# clone
d = origin.sprout(clone_path, None,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册