Make 'hg tags -q' only list tag names without revision numbers and hashes,
and change bash_completion to use this.
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -29,8 +29,8 @@ shopt -s extglob
_hg_tags()
{
- local tags="$("$hg" tags 2>/dev/null |
- sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')"
+ local tags="$("$hg" tags -q 2>/dev/null)"
+ local IFS=$'\n'
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur"))
}
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2691,7 +2691,10 @@ def tags(ui, repo):
r = "%5d:%s" % (repo.changelog.rev(n), hex(n))
except KeyError:
r = " ?:?"
- ui.write("%-30s %s\n" % (t, r))
+ if ui.quiet:
+ ui.write("%s\n" % t)
+ else:
+ ui.write("%-30s %s\n" % (t, r))
def tip(ui, repo, **opts):
"""show the tip revision