Mercurial > hg > gitweb
changeset 1561:9c6d0abdb94e
disallow '\n' and '\r' in tag names
add a test for disallowed characters in tag names
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 29 Nov 2005 22:29:14 +0100 |
parents | 6efad1cc07de |
children | 2f97af0b522c |
files | mercurial/commands.py tests/test-tag tests/test-tag.out |
diffstat | 3 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Tue Nov 29 18:06:23 2005 +0100 +++ b/mercurial/commands.py Tue Nov 29 22:29:14 2005 +0100 @@ -2002,8 +2002,10 @@ else: r = hex(repo.changelog.tip()) - if name.find(revrangesep) >= 0: - raise util.Abort(_("'%s' cannot be used in a tag name") % revrangesep) + disallowed = (revrangesep, '\r', '\n') + for c in disallowed: + if name.find(c) >= 0: + raise util.Abort(_("%s cannot be used in a tag name") % repr(c)) if opts['local']: repo.opener("localtags", "a").write("%s %s\n" % (r, name))