mercurial/commands.py
changeset 17821 361ab1e2086f
parent 17818 5023027240a1
child 17822 c284085d17a8
--- a/mercurial/commands.py	Wed Oct 17 21:39:07 2012 -0500
+++ b/mercurial/commands.py	Wed Oct 17 21:42:06 2012 -0500
@@ -794,11 +794,7 @@
         if not mark:
             raise util.Abort(_("bookmark names cannot consist entirely of "
                                "whitespace"))
-        for c in (':', '\0', '\n', '\r'):
-            if c in mark:
-                raise util.Abort(_("bookmark '%s' contains illegal "
-                    "character" % mark))
-        scmutil.checknewlabel(repo, mark)
+        scmutil.checknewlabel(repo, mark, 'bookmark')
         return mark
 
     def checkconflict(repo, mark, force=False):
@@ -5645,7 +5641,7 @@
         if len(names) != len(set(names)):
             raise util.Abort(_('tag names must be unique'))
         for n in names:
-            scmutil.checknewlabel(repo, n)
+            scmutil.checknewlabel(repo, n, 'tag')
             if not n:
                 raise util.Abort(_('tag names cannot consist entirely of '
                                    'whitespace'))