##// END OF EJS Templates
disallow '\n' and '\r' in tag names...
Benoit Boissinot -
r1561:9c6d0abd default
parent child Browse files
Show More
@@ -2002,8 +2002,10 b' def tag(ui, repo, name, rev=None, **opts'
2002 2002 else:
2003 2003 r = hex(repo.changelog.tip())
2004 2004
2005 if name.find(revrangesep) >= 0:
2006 raise util.Abort(_("'%s' cannot be used in a tag name") % revrangesep)
2005 disallowed = (revrangesep, '\r', '\n')
2006 for c in disallowed:
2007 if name.find(c) >= 0:
2008 raise util.Abort(_("%s cannot be used in a tag name") % repr(c))
2007 2009
2008 2010 if opts['local']:
2009 2011 repo.opener("localtags", "a").write("%s %s\n" % (r, name))
@@ -11,3 +11,7 b' hg history'
11 11 echo foo >> .hgtags
12 12 hg tag -d "0 0" "bleah2" || echo "failed"
13 13
14 hg tag -l 'xx
15 newline'
16 hg tag -l 'xx:xx'
17 true
@@ -18,3 +18,5 b' summary: test'
18 18
19 19 abort: working copy of .hgtags is changed (please commit .hgtags manually)
20 20 failed
21 abort: '\n' cannot be used in a tag name
22 abort: ':' cannot be used in a tag name
General Comments 0
You need to be logged in to leave comments. Login now