aboutsummaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/git-remote-hg
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-24 21:29:55 -0500
committerJunio C Hamano <gitster@pobox.com>2013-05-28 08:02:05 -0700
commitb688911a789e4eb1cfb97e1a59df0b14817b9d1a (patch)
treebd48dafb50e7813ac1d259d37ed1d101135e4310 /contrib/remote-helpers/git-remote-hg
parentc2f7a82032bff3f516aa7d029506aed096a01e0b (diff)
downloadgit-b688911a789e4eb1cfb97e1a59df0b14817b9d1a.tar.gz
git-b688911a789e4eb1cfb97e1a59df0b14817b9d1a.tar.xz
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>
Diffstat (limited to 'contrib/remote-helpers/git-remote-hg')
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg19
1 files changed, 9 insertions, 10 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 5ad5c1e1a..a1b22f7c6 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -580,11 +580,11 @@ def get_branch_tip(repo, branch):
def list_head(repo, cur):
global g_head, bmarks, fake_bmark
- if 'default' not in repo:
+ if 'default' not in branches:
# empty repo
return
- node = repo['default']
+ node = repo[branch_tip('default')]
head = 'master' if not 'master' in bmarks else 'default'
fake_bmark = head
bmarks[head] = node
@@ -601,18 +601,17 @@ def do_list(parser):
bmarks[bmark] = repo[node]
cur = repo.dirstate.branch()
+ orig = peer if peer else repo
+
+ for branch, heads in orig.branchmap().iteritems():
+ # only open heads
+ heads = [h for h in heads if 'close' not in repo.changelog.read(h)[5]]
+ if heads:
+ branches[branch] = heads
list_head(repo, cur)
if track_branches:
- orig = peer if peer else repo
-
- for branch, heads in orig.branchmap().iteritems():
- # only open heads
- heads = [h for h in heads if 'close' not in repo.changelog.read(h)[5]]
- if heads:
- branches[branch] = heads
-
for branch in branches:
print "? refs/heads/branches/%s" % gitref(branch)