remote-hg: use remote 'default' not local one

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed May 24, 2013 at 21:29 UTC b688911a789e4eb1cfb97e1a59df0b14817b9d1a
2 files changed +10 -11
contrib/remote-helpers/git-remote-hg
+9 -10
@@ -580,11 +580,11 @@ def get_branch_tip(repo, branch):
580 def list_head(repo, cur):
581 global g_head, bmarks, fake_bmark
582
583 - if 'default' not in repo:
583 + if 'default' not in branches:
584 # empty repo
585 return
586
587 - node = repo['default']
587 + node = repo[branch_tip('default')]
588 head = 'master' if not 'master' in bmarks else 'default'
589 fake_bmark = head
590 bmarks[head] = node
@@ -601,18 +601,17 @@ def do_list(parser):
601 bmarks[bmark] = repo[node]
602
603 cur = repo.dirstate.branch()
604 + orig = peer if peer else repo
605 +
606 + for branch, heads in orig.branchmap().iteritems():
607 + # only open heads
608 + heads = [h for h in heads if 'close' not in repo.changelog.read(h)[5]]
609 + if heads:
610 + branches[branch] = heads
611
612 list_head(repo, cur)
613
614 if track_branches:
608 - orig = peer if peer else repo
609 -
610 - for branch, heads in orig.branchmap().iteritems():
611 - # only open heads
612 - heads = [h for h in heads if 'close' not in repo.changelog.read(h)[5]]
613 - if heads:
614 - branches[branch] = heads
615 -
615 for branch in branches:
616 print "? refs/heads/branches/%s" % gitref(branch)
617
contrib/remote-helpers/test-hg.sh
+1 -1
@@ -486,7 +486,7 @@ test_expect_success 'remote big push' '
486 check_bookmark hgrepo new_bmark ''
487 '
488
489 -test_expect_failure 'remote double failed push' '
489 +test_expect_success 'remote double failed push' '
490 test_when_finished "rm -rf hgrepo gitrepo*" &&
491
492 (