# HG changeset patch # User Osku Salerma # Date 1197188078 -32400 # Node ID ae3089cefaab41c90d0fa96681c67e5be7f71a1d # Parent 47915bf68c446fe7cbee49ad4dbc516c5575fcf3 Add --verbose support to tags command. diff -r 47915bf68c44 -r ae3089cefaab mercurial/commands.py --- 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 diff -r 47915bf68c44 -r ae3089cefaab tests/test-tags --- a/tests/test-tags Sun Dec 09 16:32:05 2007 +0900 +++ b/tests/test-tags Sun Dec 09 17:14:38 2007 +0900 @@ -142,4 +142,5 @@ hg tag -r 0 globaltag hg tag --remove -l globaltag +hg tags -v exit 0 diff -r 47915bf68c44 -r ae3089cefaab tests/test-tags.out --- a/tests/test-tags.out Sun Dec 09 16:32:05 2007 +0900 +++ b/tests/test-tags.out Sun Dec 09 17:14:38 2007 +0900 @@ -74,3 +74,6 @@ adding foo abort: localtag tag is local abort: globaltag tag is global +tip 1:a0b6fe111088 +localtag 0:bbd179dfa0a7 local +globaltag 0:bbd179dfa0a7