mercurial/commands.py
changeset 20191 cbe2bcc927cd
parent 20184 a14d93b2fb1b
child 20192 38fad5e76ee8
--- 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 = ['']