From: Felipe Contreras Date: Sat, 25 May 2013 02:29:54 +0000 (-0500) Subject: remote-hg: improve branch listing X-Git-Tag: v1.8.4-rc0~191^2~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c2f7a82032bff3f516aa7d029506aed096a01e0b?hp=--cc 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 Signed-off-by: Junio C Hamano --- c2f7a82032bff3f516aa7d029506aed096a01e0b diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 8df72d90c8..5ad5c1e1a3 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -605,9 +605,12 @@ def do_list(parser): list_head(repo, cur) if track_branches: - for branch in repo.branchmap(): - heads = repo.branchheads(branch) - if len(heads): + 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: