diff mercurial/localrepo.py @ 17821:361ab1e2086f

scmutil: add bad character checking to checknewlabel This factors out the checks from tags and bookmarks, and newly applies the same prohibitions to branches. checknewlabel takes a new parameter, kind, indicating the kind of label being checked. Test coverage is added for all three types of labels.
author Kevin Bullock <kbullock@ringworld.org>
date Wed, 17 Oct 2012 21:42:06 -0500
parents c547e1acc37c
children 0c1185f6ddd7
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Oct 17 21:39:07 2012 -0500
+++ b/mercurial/localrepo.py	Wed Oct 17 21:42:06 2012 -0500
@@ -385,17 +385,9 @@
     def hook(self, name, throw=False, **args):
         return hook.hook(self.ui, self, name, throw, **args)
 
-    tag_disallowed = ':\0\r\n'
-
     def _tag(self, names, node, message, local, user, date, extra={}):
         if isinstance(names, str):
-            allchars = names
             names = (names,)
-        else:
-            allchars = ''.join(names)
-        for c in self.tag_disallowed:
-            if c in allchars:
-                raise util.Abort(_('%r cannot be used in a tag name') % c)
 
         branches = self.branchmap()
         for name in names: