Mercurial > hg-stable
changeset 5658:ae3089cefaab
Add --verbose support to tags command.
author | Osku Salerma <osku@iki.fi> |
---|---|
date | Sun, 09 Dec 2007 17:14:38 +0900 |
parents | 47915bf68c44 |
children | 3da652f2039c |
files | mercurial/commands.py tests/test-tags tests/test-tags.out |
diffstat | 3 files changed, 19 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Dec 09 16:32:05 2007 +0900 +++ b/mercurial/commands.py Sun Dec 09 17:14:38 2007 +0900 @@ -2458,23 +2458,33 @@ List the repository tags. - This lists both regular and local tags. + This lists both regular and local tags. When the -v/--verbose switch + is used, a third column "local" is printed for local tags. """ l = repo.tagslist() l.reverse() hexfunc = ui.debugflag and hex or short + tagtype = "" + for t, n in l: + if ui.quiet: + ui.write("%s\n" % t) + continue + try: hn = hexfunc(n) - r = "%5d:%s" % (repo.changelog.rev(n), hexfunc(n)) + r = "%5d:%s" % (repo.changelog.rev(n), hn) except revlog.LookupError: r = " ?:%s" % hn - if ui.quiet: - ui.write("%s\n" % t) else: spaces = " " * (30 - util.locallen(t)) - ui.write("%s%s %s\n" % (t, spaces, r)) + if ui.verbose: + if repo.tagtype(t) == 'local': + tagtype = " local" + else: + tagtype = "" + ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype)) def tip(ui, repo, **opts): """show the tip revision