summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Felipe Contreras <felipe.contreras@gmail.com>2013-05-24 21:29:47 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-05-28 08:02:04 -0700
commitdfcef29f2f32046f3edbcaee47a03d94bc237eb8 (patch)
tree5a72046098e68285cfa595147e5b676019483476 /contrib
parentremote-hg: reorganize bookmark handling (diff)
downloadtgif-dfcef29f2f32046f3edbcaee47a03d94bc237eb8.tar.xz
remote-hg: force remote bookmark push selectively
If we update the 'old' node, we might be updating the remote bookmark even when our 'new' node is not related at all to what the remote has, effectively forcing an update. Let's do that only when forced push is configured. 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-hg3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 99de7c2ff0..4d650b5f60 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -919,7 +919,8 @@ def do_export(parser):
# update remote bookmarks
remote_bmarks = peer.listkeys('bookmarks')
for ref, bmark, old, new in p_bmarks:
- old = remote_bmarks.get(bmark, '')
+ if force_push:
+ old = remote_bmarks.get(bmark, '')
if not peer.pushkey('bookmarks', bmark, old, new):
print "error %s" % ref
else: