[PATCH 44/47] remote-hg: improve branch listing
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 14, 2013, 04:37 UTC
- Message-ID
- <1368506230-19614-45-git-send-email-felipe.contreras@gmail.com>
- In-Reply-To
- <1368506230-19614-1-git-send-email-felipe.contreras@gmail.com>
We want to show the remote heads, not the internal ones, which might have garbage.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- contrib/remote-helpers/git-remote-hg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index aff1161..cacf2da 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -585,9 +585,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 not repo[h].closesbranch()] + if heads: branches[branch] = heads for branch in branches:
-- 1.8.3.rc1.579.g184e698