remote-hg: make sure fake bookmarks are updated
authorFelipe Contreras <felipe.contreras@gmail.com>
Thu, 11 Apr 2013 12:23:01 +0000 (07:23 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Apr 2013 17:46:46 +0000 (10:46 -0700)
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/remote-helpers/git-remote-hg
contrib/remote-helpers/test-hg-bidi.sh
contrib/remote-helpers/test-hg-hg-git.sh
index c6a1a47cc8ec29badfc630a1140ca1cdaafed6f9..b200e60c7031656c465b0ab988a23f3148cf4a90 100755 (executable)
@@ -709,9 +709,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, {})
index 1d6198243667c655639781019d8d608e0791e00b..fe38e49bc1c5f744ca871846a51471d1f6733ccd 100755 (executable)
@@ -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/*'
        ) &&
index 7e3967f5b6f0c19939bf1c0c30be0d756ec6aa04..4c71c45d0aff731e96701c553f26fe078a4ab6f4 100755 (executable)
@@ -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/*'
        ) &&