##// END OF EJS Templates
debugnamecomplete: rename from debuglabelcomplete...
Sean Farley -
r23762:0390cc32 default
parent child Browse files
Show More
@@ -110,7 +110,7 b' shopt -s extglob'
110
110
111 _hg_labels()
111 _hg_labels()
112 {
112 {
113 local labels="$(_hg_cmd debuglabelcomplete "$cur")"
113 local labels="$(_hg_cmd debugnamecomplete "$cur")"
114 local IFS=$'\n'
114 local IFS=$'\n'
115 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$labels' -- "$cur"))
115 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$labels' -- "$cur"))
116 }
116 }
@@ -163,7 +163,7 b' typeset -A _hg_cmd_globals'
163 }
163 }
164
164
165 _hg_labels() {
165 _hg_labels() {
166 labels=("${(f)$(_hg_cmd debuglabelcomplete)}")
166 labels=("${(f)$(_hg_cmd debugnamecomplete)}")
167 (( $#labels )) && _describe -t labels 'labels' labels
167 (( $#labels )) && _describe -t labels 'labels' labels
168 }
168 }
169
169
@@ -2344,18 +2344,23 b' def debugknown(ui, repopath, *ids, **opt'
2344
2344
2345 @command('debuglabelcomplete', [], _('LABEL...'))
2345 @command('debuglabelcomplete', [], _('LABEL...'))
2346 def debuglabelcomplete(ui, repo, *args):
2346 def debuglabelcomplete(ui, repo, *args):
2347 '''complete "labels" - tags, open branch names, bookmark names'''
2347 '''backwards compatibility with old bash completion scripts (DEPRECATED)'''
2348
2348 debugnamecomplete(ui, repo, *args)
2349 labels = set()
2349
2350 labels.update(t[0] for t in repo.tagslist())
2350 @command('debugnamecomplete', [], _('NAME...'))
2351 labels.update(repo._bookmarks.keys())
2351 def debugnamecomplete(ui, repo, *args):
2352 labels.update(tag for (tag, heads, tip, closed)
2352 '''complete "names" - tags, open branch names, bookmark names'''
2353 in repo.branchmap().iterbranches() if not closed)
2353
2354 names = set()
2355 names.update(t[0] for t in repo.tagslist())
2356 names.update(repo._bookmarks.keys())
2357 names.update(tag for (tag, heads, tip, closed)
2358 in repo.branchmap().iterbranches() if not closed)
2354 completions = set()
2359 completions = set()
2355 if not args:
2360 if not args:
2356 args = ['']
2361 args = ['']
2357 for a in args:
2362 for a in args:
2358 completions.update(l for l in labels if l.startswith(a))
2363 completions.update(n for n in names if n.startswith(a))
2359 ui.write('\n'.join(sorted(completions)))
2364 ui.write('\n'.join(sorted(completions)))
2360 ui.write('\n')
2365 ui.write('\n')
2361
2366
@@ -90,6 +90,7 b' Show debug commands if there are no othe'
90 debugknown
90 debugknown
91 debuglabelcomplete
91 debuglabelcomplete
92 debuglocks
92 debuglocks
93 debugnamecomplete
93 debugobsolete
94 debugobsolete
94 debugpathcomplete
95 debugpathcomplete
95 debugpushkey
96 debugpushkey
@@ -247,6 +248,7 b' Show all commands + options'
247 debugknown:
248 debugknown:
248 debuglabelcomplete:
249 debuglabelcomplete:
249 debuglocks: force-lock, force-wlock
250 debuglocks: force-lock, force-wlock
251 debugnamecomplete:
250 debugobsolete: flags, record-parents, rev, date, user
252 debugobsolete: flags, record-parents, rev, date, user
251 debugpathcomplete: full, normal, added, removed
253 debugpathcomplete: full, normal, added, removed
252 debugpushkey:
254 debugpushkey:
@@ -321,16 +323,16 b' Test debugpathcomplete'
321 $ hg debugpathcomplete -r F
323 $ hg debugpathcomplete -r F
322 Fum
324 Fum
323
325
324 Test debuglabelcomplete
326 Test debugnamecomplete
325
327
326 $ hg debuglabelcomplete
328 $ hg debugnamecomplete
327 Fum
329 Fum
328 default
330 default
329 fee
331 fee
330 fie
332 fie
331 fo
333 fo
332 tip
334 tip
333 $ hg debuglabelcomplete f
335 $ hg debugnamecomplete f
334 fee
336 fee
335 fie
337 fie
336 fo
338 fo
@@ -780,9 +780,9 b' Test list of internal help commands'
780 dump an index DAG as a graphviz dot file
780 dump an index DAG as a graphviz dot file
781 debuginstall test Mercurial installation
781 debuginstall test Mercurial installation
782 debugknown test whether node ids are known to a repo
782 debugknown test whether node ids are known to a repo
783 debuglabelcomplete
784 complete "labels" - tags, open branch names, bookmark names
785 debuglocks show or modify state of locks
783 debuglocks show or modify state of locks
784 debugnamecomplete
785 complete "names" - tags, open branch names, bookmark names
786 debugobsolete
786 debugobsolete
787 create arbitrary obsolete marker
787 create arbitrary obsolete marker
788 debugoptDEP (no help text available)
788 debugoptDEP (no help text available)
General Comments 0
You need to be logged in to leave comments. Login now