From 94350fefff259ffa35a30f739e2ecd327f2556a9 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Thu, 11 Apr 2013 07:23:01 -0500 Subject: [PATCH] remote-hg: make sure fake bookmarks are updated Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- git-remote-hg | 7 +++++++ test-hg-bidi.sh | 1 + test-hg-hg-git.sh | 1 + 3 files changed, 9 insertions(+) diff --git a/git-remote-hg b/git-remote-hg index 928af04..bf3aafe 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -710,9 +710,16 @@ def do_export(parser): old = bmarks[bmark].hex() else: old = '' + + if bmark == 'master' and 'master' not in parser.repo._bookmarks: + # fake bookmark + print "ok %s" % ref + continue + if not bookmarks.pushbookmark(parser.repo, bmark, old, node): print "error %s" % ref continue + elif ref.startswith('refs/tags/'): tag = ref[len('refs/tags/'):] parser.repo.tag([tag], node, None, True, None, {}) diff --git a/test-hg-bidi.sh b/test-hg-bidi.sh index 1d61982..fe38e49 100755 --- a/test-hg-bidi.sh +++ b/test-hg-bidi.sh @@ -30,6 +30,7 @@ git_clone () { hg_clone () { ( hg init $2 && + hg -R $2 bookmark -i master && cd $1 && git push -q "hg::$PWD/../$2" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' ) && diff --git a/test-hg-hg-git.sh b/test-hg-hg-git.sh index 3f253b7..e116cb0 100755 --- a/test-hg-hg-git.sh +++ b/test-hg-hg-git.sh @@ -35,6 +35,7 @@ git_clone_git () { hg_clone_git () { ( hg init $2 && + hg -R $2 bookmark -i master && cd $1 && git push -q "hg::$PWD/../$2" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' ) &&