diff mercurial/commands.py @ 17818:5023027240a1

bookmarks: use scmutil.checknewlabel Validation is pulled up into the commands module to avoid an import cycle.
author Kevin Bullock <kbullock@ringworld.org>
date Wed, 17 Oct 2012 17:23:39 -0500
parents b17be267b59c
children 361ab1e2086f
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Oct 17 16:34:46 2012 -0500
+++ b/mercurial/commands.py	Wed Oct 17 17:23:39 2012 -0500
@@ -794,6 +794,11 @@
         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)
         return mark
 
     def checkconflict(repo, mark, force=False):