changeset 20191:cbe2bcc927cd

debuglabelcomplete: simplify with repo.branchmap().iterbranches()
author Brodie Rao <brodie@sf.io>
date Mon, 16 Sep 2013 01:08:29 -0700
parents d5d25e541637
children 38fad5e76ee8
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Sep 16 01:08:29 2013 -0700
+++ b/mercurial/commands.py	Mon Sep 16 01:08:29 2013 -0700
@@ -2143,11 +2143,8 @@
     labels = set()
     labels.update(t[0] for t in repo.tagslist())
     labels.update(repo._bookmarks.keys())
-    for heads in repo.branchmap().itervalues():
-        for h in heads:
-            ctx = repo[h]
-            if not ctx.closesbranch():
-                labels.add(ctx.branch())
+    labels.update(tag for (tag, heads, tip, closed)
+                  in repo.branchmap().iterbranches() if not closed)
     completions = set()
     if not args:
         args = ['']