remote-hg: improve branch listing

We want to show the remote heads, not the internal ones, which might have garbage. 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 c2f7a82032bff3f516aa7d029506aed096a01e0b
1 file changed +6 -3
contrib/remote-helpers/git-remote-hg
+6 -3
@@ -605,9 +605,12 @@ def do_list(parser):
605 list_head(repo, cur)
606
607 if track_branches:
608 - for branch in repo.branchmap():
609 - heads = repo.branchheads(branch)
610 - if len(heads):
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
616 for branch in branches: