debuglabelcomplete: simplify with repo.branchmap().iterbranches()
authorBrodie Rao <brodie@sf.io>
Mon, 16 Sep 2013 01:08:29 -0700
changeset 20191 cbe2bcc927cd
parent 20190 d5d25e541637
child 20192 38fad5e76ee8
debuglabelcomplete: simplify with repo.branchmap().iterbranches()
mercurial/commands.py
--- 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 = ['']