bookmarks: remove redundant check for newline
authorKevin Bullock <kbullock@ringworld.org>
Wed, 17 Oct 2012 16:23:42 -0500
changeset 17814 f88ca484c3e9
parent 17813 813db1dccc05
child 17815 be1467342038
bookmarks: remove redundant check for newline New bookmarks are already checked for illegal characters (':', '\0', '\n', and '\r') in bookmarks.valid().
mercurial/commands.py
tests/test-bookmarks.t
--- a/mercurial/commands.py	Wed Oct 17 22:25:41 2012 -0500
+++ b/mercurial/commands.py	Wed Oct 17 16:23:42 2012 -0500
@@ -790,8 +790,6 @@
     cur   = repo.changectx('.').node()
 
     def checkformat(mark):
-        if "\n" in mark:
-            raise util.Abort(_("bookmark name cannot contain newlines"))
         mark = mark.strip()
         if not mark:
             raise util.Abort(_("bookmark names cannot consist entirely of "
--- a/tests/test-bookmarks.t	Wed Oct 17 22:25:41 2012 -0500
+++ b/tests/test-bookmarks.t	Wed Oct 17 16:23:42 2012 -0500
@@ -214,12 +214,12 @@
 
   $ hg bookmark '
   > '
-  abort: bookmark name cannot contain newlines
+  abort: bookmark names cannot consist entirely of whitespace
   [255]
 
   $ hg bookmark -m Z '
   > '
-  abort: bookmark name cannot contain newlines
+  abort: bookmark names cannot consist entirely of whitespace
   [255]
 
 bookmark with existing name