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>

Felipe Contreras committed May 24, 2013 at 21:29 UTC dfcef29f2f32046f3edbcaee47a03d94bc237eb8
1 file changed +2 -1
contrib/remote-helpers/git-remote-hg
+2 -1
@@ -919,7 +919,8 @@ def do_export(parser):
919 # update remote bookmarks
920 remote_bmarks = peer.listkeys('bookmarks')
921 for ref, bmark, old, new in p_bmarks:
922 - old = remote_bmarks.get(bmark, '')
922 + if force_push:
923 + old = remote_bmarks.get(bmark, '')
924 if not peer.pushkey('bookmarks', bmark, old, new):
925 print "error %s" % ref
926 else: