comparison mercurial/commands.py @ 1596:41366b7d6709

fix 'hg tag <tagname> <revision> - fix a collision with the option keyword rev and the option name - update the tests
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 27 Dec 2005 12:52:10 -0600
parents fce5292866c6
children 728fd9584993
comparison
equal deleted inserted replaced
1595:dca956c9767d 1596:41366b7d6709
2017 format = "%s %%s%s" % (char, end); 2017 format = "%s %%s%s" % (char, end);
2018 2018
2019 for f in changes: 2019 for f in changes:
2020 ui.write(format % f) 2020 ui.write(format % f)
2021 2021
2022 def tag(ui, repo, name, rev=None, **opts): 2022 def tag(ui, repo, name, rev_=None, **opts):
2023 """add a tag for the current tip or a given revision 2023 """add a tag for the current tip or a given revision
2024 2024
2025 Name a particular revision using <name>. 2025 Name a particular revision using <name>.
2026 2026
2027 Tags are used to name particular revisions of the repository and are 2027 Tags are used to name particular revisions of the repository and are
2035 similarly to other project files and can be hand-edited if 2035 similarly to other project files and can be hand-edited if
2036 necessary. 2036 necessary.
2037 """ 2037 """
2038 if name == "tip": 2038 if name == "tip":
2039 raise util.Abort(_("the name 'tip' is reserved")) 2039 raise util.Abort(_("the name 'tip' is reserved"))
2040 if 'rev' in opts: 2040 if opts['rev']:
2041 rev = opts['rev'] 2041 rev_ = opts['rev']
2042 if rev: 2042 if rev_:
2043 r = hex(repo.lookup(rev)) 2043 r = hex(repo.lookup(rev_))
2044 else: 2044 else:
2045 r = hex(repo.changelog.tip()) 2045 r = hex(repo.changelog.tip())
2046 2046
2047 disallowed = (revrangesep, '\r', '\n') 2047 disallowed = (revrangesep, '\r', '\n')
2048 for c in disallowed: 2048 for c in disallowed: