summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-01 01:09:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-01 05:06:47 (GMT)
commit38e7167e9bdc57262c7298912c4bf9df4d68f6fe (patch)
tree66b0bd2acb0d2a05a93bfa62f7feae4fe6e2e831 /contrib
parentf38dfc4c32507de2f7cf05350fe8b34fd4edd45d (diff)
downloadgit-38e7167e9bdc57262c7298912c4bf9df4d68f6fe.zip
git-38e7167e9bdc57262c7298912c4bf9df4d68f6fe.tar.gz
git-38e7167e9bdc57262c7298912c4bf9df4d68f6fe.tar.bz2
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>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/remote-helpers/git-remote-bzr8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index 6a7f836..bf254a0 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -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,