##// END OF EJS Templates
Add --verbose support to tags command.
Osku Salerma -
r5658:ae3089ce default
parent child Browse files
Show More
@@ -2458,23 +2458,33 b' def tags(ui, repo):'
2458
2458
2459 List the repository tags.
2459 List the repository tags.
2460
2460
2461 This lists both regular and local tags.
2461 This lists both regular and local tags. When the -v/--verbose switch
2462 is used, a third column "local" is printed for local tags.
2462 """
2463 """
2463
2464
2464 l = repo.tagslist()
2465 l = repo.tagslist()
2465 l.reverse()
2466 l.reverse()
2466 hexfunc = ui.debugflag and hex or short
2467 hexfunc = ui.debugflag and hex or short
2468 tagtype = ""
2469
2467 for t, n in l:
2470 for t, n in l:
2471 if ui.quiet:
2472 ui.write("%s\n" % t)
2473 continue
2474
2468 try:
2475 try:
2469 hn = hexfunc(n)
2476 hn = hexfunc(n)
2470 r = "%5d:%s" % (repo.changelog.rev(n), hexfunc(n))
2477 r = "%5d:%s" % (repo.changelog.rev(n), hn)
2471 except revlog.LookupError:
2478 except revlog.LookupError:
2472 r = " ?:%s" % hn
2479 r = " ?:%s" % hn
2473 if ui.quiet:
2474 ui.write("%s\n" % t)
2475 else:
2480 else:
2476 spaces = " " * (30 - util.locallen(t))
2481 spaces = " " * (30 - util.locallen(t))
2477 ui.write("%s%s %s\n" % (t, spaces, r))
2482 if ui.verbose:
2483 if repo.tagtype(t) == 'local':
2484 tagtype = " local"
2485 else:
2486 tagtype = ""
2487 ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype))
2478
2488
2479 def tip(ui, repo, **opts):
2489 def tip(ui, repo, **opts):
2480 """show the tip revision
2490 """show the tip revision
@@ -142,4 +142,5 b' hg tag --remove localtag'
142
142
143 hg tag -r 0 globaltag
143 hg tag -r 0 globaltag
144 hg tag --remove -l globaltag
144 hg tag --remove -l globaltag
145 hg tags -v
145 exit 0
146 exit 0
@@ -74,3 +74,6 b' bar 2:72b'
74 adding foo
74 adding foo
75 abort: localtag tag is local
75 abort: localtag tag is local
76 abort: globaltag tag is global
76 abort: globaltag tag is global
77 tip 1:a0b6fe111088
78 localtag 0:bbd179dfa0a7 local
79 globaltag 0:bbd179dfa0a7
General Comments 0
You need to be logged in to leave comments. Login now