comparison mercurial/commands.py @ 20191:cbe2bcc927cd

debuglabelcomplete: simplify with repo.branchmap().iterbranches()
author Brodie Rao <brodie@sf.io>
date Mon, 16 Sep 2013 01:08:29 -0700
parents a14d93b2fb1b
children 38fad5e76ee8
comparison
equal deleted inserted replaced
20190:d5d25e541637 20191:cbe2bcc927cd
2141 '''complete "labels" - tags, open branch names, bookmark names''' 2141 '''complete "labels" - tags, open branch names, bookmark names'''
2142 2142
2143 labels = set() 2143 labels = set()
2144 labels.update(t[0] for t in repo.tagslist()) 2144 labels.update(t[0] for t in repo.tagslist())
2145 labels.update(repo._bookmarks.keys()) 2145 labels.update(repo._bookmarks.keys())
2146 for heads in repo.branchmap().itervalues(): 2146 labels.update(tag for (tag, heads, tip, closed)
2147 for h in heads: 2147 in repo.branchmap().iterbranches() if not closed)
2148 ctx = repo[h]
2149 if not ctx.closesbranch():
2150 labels.add(ctx.branch())
2151 completions = set() 2148 completions = set()
2152 if not args: 2149 if not args:
2153 args = [''] 2150 args = ['']
2154 for a in args: 2151 for a in args:
2155 completions.update(l for l in labels if l.startswith(a)) 2152 completions.update(l for l in labels if l.startswith(a))