[PATCH 02/16] remote-hg: safer bookmark pushing
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Apr 22, 2013, 21:55 UTC
- Message-ID
- <1366667724-567-3-git-send-email-felipe.contreras@gmail.com>
- In-Reply-To
- <1366667724-567-1-git-send-email-felipe.contreras@gmail.com>
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> --- contrib/remote-helpers/git-remote-hg | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 2cd1996..dcf6c98 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -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
-- 1.8.2.1.790.g4588561