From: Felipe Contreras Date: Sat, 25 May 2013 02:29:47 GMT Subject: [PATCH v2 31/48] remote-hg: force remote bookmark push selectively Message-ID: <1369449004-17981-32-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1369449004-17981-1-git-send-email-felipe.contreras@gmail.com> 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 --- contrib/remote-helpers/git-remote-hg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 99de7c2..4d650b5 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: -- 1.8.3.rc3.312.g47657de