Browse Source

remote-hg: make sure fake bookmarks are updated

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Felipe Contreras 12 years ago committed by Junio C Hamano
parent
commit
8120014e2b
  1. 7
      contrib/remote-helpers/git-remote-hg
  2. 1
      contrib/remote-helpers/test-hg-bidi.sh
  3. 1
      contrib/remote-helpers/test-hg-hg-git.sh

7
contrib/remote-helpers/git-remote-hg

@ -709,9 +709,16 @@ def do_export(parser): @@ -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, {})

1
contrib/remote-helpers/test-hg-bidi.sh

@ -30,6 +30,7 @@ git_clone () { @@ -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/*'
) &&

1
contrib/remote-helpers/test-hg-hg-git.sh

@ -35,6 +35,7 @@ git_clone_git () { @@ -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/*'
) &&

Loading…
Cancel
Save