]> Pileus Git - ~andy/git/commitdiff
remote-hg: safer bookmark pushing
authorFelipe Contreras <felipe.contreras@gmail.com>
Mon, 22 Apr 2013 21:55:10 +0000 (16:55 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Apr 2013 22:25:53 +0000 (15:25 -0700)
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>
contrib/remote-helpers/git-remote-hg

index 2cd199662632b1e9873adc32a5c201f42c27fcd2..dcf6c989a724a964de93202daa9c2c2eb4d2933f 100755 (executable)
@@ -782,6 +782,8 @@ def do_export(parser):
             continue
 
         if peer:
+            rb = peer.listkeys('bookmarks')
+            old = rb.get(bmark, '')
             if not peer.pushkey('bookmarks', bmark, old, new):
                 print "error %s" % ref
                 continue