Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 13893:1aea86673dee
tags: no need to check for valid nodes
_findtags in localrepo checks that nodes exist in the revlog so we
can't get a LookupError here.
The output of 'hg tags' stays the same since tags to unknown nodes
didn't get printed before anyway due to ae3089cefaab.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Mon, 04 Apr 2011 23:43:22 +0300 |
parents | 1bd9f3a6a0d0 |
children | a7cd0eee396b |
comparison
equal
deleted
inserted
replaced
13892:31d15f761631 | 13893:1aea86673dee |
---|---|
4059 for t, n in reversed(repo.tagslist()): | 4059 for t, n in reversed(repo.tagslist()): |
4060 if ui.quiet: | 4060 if ui.quiet: |
4061 ui.write("%s\n" % t) | 4061 ui.write("%s\n" % t) |
4062 continue | 4062 continue |
4063 | 4063 |
4064 try: | 4064 hn = hexfunc(n) |
4065 hn = hexfunc(n) | 4065 r = "%5d:%s" % (repo.changelog.rev(n), hn) |
4066 r = "%5d:%s" % (repo.changelog.rev(n), hn) | 4066 spaces = " " * (30 - encoding.colwidth(t)) |
4067 except error.LookupError: | 4067 |
4068 r = " ?:%s" % hn | 4068 if ui.verbose: |
4069 else: | 4069 if repo.tagtype(t) == 'local': |
4070 spaces = " " * (30 - encoding.colwidth(t)) | 4070 tagtype = " local" |
4071 if ui.verbose: | 4071 else: |
4072 if repo.tagtype(t) == 'local': | 4072 tagtype = "" |
4073 tagtype = " local" | 4073 ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype)) |
4074 else: | |
4075 tagtype = "" | |
4076 ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype)) | |
4077 | 4074 |
4078 def tip(ui, repo, **opts): | 4075 def tip(ui, repo, **opts): |
4079 """show the tip revision | 4076 """show the tip revision |
4080 | 4077 |
4081 The tip revision (usually just called the tip) is the changeset | 4078 The tip revision (usually just called the tip) is the changeset |