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>

Felipe Contreras committed Apr 22, 2013 at 16:55 UTC e5ea5e7547fbb042b6d2ed04b73ff92d7543f672
1 file changed +2
contrib/remote-helpers/git-remote-hg
+2
@@ -782,6 +782,8 @@ def do_export(parser):
782 continue
783
784 if peer:
785 + rb = peer.listkeys('bookmarks')
786 + old = rb.get(bmark, '')
787 if not peer.pushkey('bookmarks', bmark, old, new):
788 print "error %s" % ref
789 continue