changeset 11710:58a038605a2b stable

merge crew and main
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sat, 31 Jul 2010 11:04:33 +0900
parents 52e4ac3e63f7 (current diff) 3e561b6af810 (diff)
children 9cbc62f68328
files
diffstat 7 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/doc/runrst	Tue Jul 27 14:40:25 2010 -0400
+++ b/doc/runrst	Sat Jul 31 11:04:33 2010 +0900
@@ -13,9 +13,14 @@
 """
 
 import sys
-from docutils.parsers.rst import roles
-from docutils.core import publish_cmdline
-from docutils import nodes, utils
+try:
+    from docutils.parsers.rst import roles
+    from docutils.core import publish_cmdline
+    from docutils import nodes, utils
+except ImportError:
+    sys.stderr.write("abort: couldn't generate documentation: docutils "
+                     "module is missing\n")
+    sys.exit(-1)
 
 def role_hg(name, rawtext, text, lineno, inliner,
             options={}, content=[]):
--- a/hgext/bookmarks.py	Tue Jul 27 14:40:25 2010 -0400
+++ b/hgext/bookmarks.py	Sat Jul 31 11:04:33 2010 +0900
@@ -136,6 +136,9 @@
         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 "
+                               "whitespace"))
         if mark in marks and not force:
             raise util.Abort(_("a bookmark of the same name already exists"))
         if ((mark in repo.branchtags() or mark == repo.dirstate.branch())
--- a/hgext/mq.py	Tue Jul 27 14:40:25 2010 -0400
+++ b/hgext/mq.py	Sat Jul 31 11:04:33 2010 +0900
@@ -1702,7 +1702,7 @@
                     else:
                         text = url.open(self.ui, filename).read()
                 except (OSError, IOError):
-                    raise util.Abort(_("unable to read %s") % filename)
+                    raise util.Abort(_("unable to read file %s") % filename)
                 if not patchname:
                     patchname = normname(os.path.basename(filename))
                 self.check_reserved_name(patchname)
--- a/tests/test-bookmarks	Tue Jul 27 14:40:25 2010 -0400
+++ b/tests/test-bookmarks	Sat Jul 31 11:04:33 2010 +0900
@@ -100,4 +100,7 @@
 echo % revision but no bookmark name
 hg bookmark -r .
 
+echo % bookmark name with whitespace only
+hg bookmark ' '
+
 true
--- a/tests/test-bookmarks.out	Tue Jul 27 14:40:25 2010 -0400
+++ b/tests/test-bookmarks.out	Sat Jul 31 11:04:33 2010 +0900
@@ -74,3 +74,5 @@
  * x  y                      2:0316ce92851d
 % revision but no bookmark name
 abort: bookmark name required
+% bookmark name with whitespace only
+abort: bookmark names cannot consist entirely of whitespace
--- a/tests/test-mq-qimport-fail-cleanup.out	Tue Jul 27 14:40:25 2010 -0400
+++ b/tests/test-mq-qimport-fail-cleanup.out	Sat Jul 31 11:04:33 2010 +0900
@@ -4,7 +4,7 @@
 
 #qimport valid patch followed by invalid patch
 adding b.patch to series file
-abort: unable to read fakepatch
+abort: unable to read file fakepatch
 
 #valid patches before fail added to series
 b.patch
--- a/tests/test-mq-qimport.out	Tue Jul 27 14:40:25 2010 -0400
+++ b/tests/test-mq-qimport.out	Sat Jul 31 11:04:33 2010 +0900
@@ -1,5 +1,5 @@
 % qimport non-existing-file
-abort: unable to read non-existing-file
+abort: unable to read file non-existing-file
 % import email
 adding email to series file
 applying email