comparison mercurial/commands.py @ 477:520540fd6b64

Handle errors in .hgtags or hgrc [tags] section more gracefully. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Handle errors in .hgtags or hgrc [tags] section more gracefully. manifest hash: 85c62e1bf3ad78b243ee60f43c3c577700a8c96d -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCvp6jW7P1GVgWeRoRAo23AKCZRU22IweynNtf9k3q4pEyqEaozACeMIRV 6tNOkr3h6jTiMZ2bJgPeabg= =+U5s -----END PGP SIGNATURE-----
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 26 Jun 2005 13:25:07 +0100
parents 0ab093b473c5
children 7293cb91bf2a
comparison
equal deleted inserted replaced
476:0a338d506268 477:520540fd6b64
660 660
661 repo.commit([".hgtags"], opts['text'], opts['user'], opts['date']) 661 repo.commit([".hgtags"], opts['text'], opts['user'], opts['date'])
662 662
663 def tags(ui, repo): 663 def tags(ui, repo):
664 """list repository tags""" 664 """list repository tags"""
665 665
666 l = repo.tagslist() 666 l = repo.tagslist()
667 l.reverse() 667 l.reverse()
668 for t,n in l: 668 for t, n in l:
669 try: 669 try:
670 r = repo.changelog.rev(n) 670 r = "%5d:%s" % (repo.changelog.rev(n), hg.hex(n))
671 except KeyError: 671 except KeyError:
672 r = "?" 672 r = " ?:?"
673 print "%-30s %5d:%s" % (t, repo.changelog.rev(n), hg.hex(n)) 673 ui.write("%-30s %s\n" % (t, r))
674 674
675 def tip(ui, repo): 675 def tip(ui, repo):
676 """show the tip revision""" 676 """show the tip revision"""
677 n = repo.changelog.tip() 677 n = repo.changelog.tip()
678 show_changeset(ui, repo, changenode=n) 678 show_changeset(ui, repo, changenode=n)