Browse Source

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>
maint
Felipe Contreras 12 years ago committed by Junio C Hamano
parent
commit
dfcef29f2f
  1. 3
      contrib/remote-helpers/git-remote-hg

3
contrib/remote-helpers/git-remote-hg

@ -919,7 +919,8 @@ def do_export(parser):
# update remote bookmarks # update remote bookmarks
remote_bmarks = peer.listkeys('bookmarks') remote_bmarks = peer.listkeys('bookmarks')
for ref, bmark, old, new in p_bmarks: 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): if not peer.pushkey('bookmarks', bmark, old, new):
print "error %s" % ref print "error %s" % ref
else: else:

Loading…
Cancel
Save