summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/git-remote-hg
diff options
context:
space:
mode:
authorLibravatar Felipe Contreras <felipe.contreras@gmail.com>2013-04-22 16:55:10 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-22 15:25:53 -0700
commite5ea5e7547fbb042b6d2ed04b73ff92d7543f672 (patch)
tree6753de9602dff0876a1f1ec7eaa4ccecf700228c /contrib/remote-helpers/git-remote-hg
parentremote-helpers: avoid has_key (diff)
downloadtgif-e5ea5e7547fbb042b6d2ed04b73ff92d7543f672.tar.xz
remote-hg: safer bookmark pushing
It is possible that the remote has changed the bookmarks, so let's fetch them before we make any assumptions, just the way mercurial does. Probably doesn't make a difference, but better be safe than sorry. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/git-remote-hg')
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 2cd1996626..dcf6c989a7 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -782,6 +782,8 @@ def do_export(parser):
continue
if peer:
+ rb = peer.listkeys('bookmarks')
+ old = rb.get(bmark, '')
if not peer.pushkey('bookmarks', bmark, old, new):
print "error %s" % ref
continue