diff --git a/doc/runrst b/doc/runrst --- a/doc/runrst +++ b/doc/runrst @@ -13,9 +13,14 @@ where WRITER is the name of a Docutils w """ 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=[]): diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1713,7 +1713,7 @@ class queue(object): 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) diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -395,7 +395,7 @@ def _dispatch(ui, args): try: wd = os.getcwd() except OSError, e: - raise util.Abort(_("error getting current working directory: %s") % + raise util.Abort(_("error getting current working directory: %s") % e.strerror) path = cmdutil.findrepo(wd) or "" if not path: diff --git a/tests/test-mq-qimport-fail-cleanup.out b/tests/test-mq-qimport-fail-cleanup.out --- a/tests/test-mq-qimport-fail-cleanup.out +++ b/tests/test-mq-qimport-fail-cleanup.out @@ -4,7 +4,7 @@ adding a #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 diff --git a/tests/test-mq-qimport.out b/tests/test-mq-qimport.out --- a/tests/test-mq-qimport.out +++ b/tests/test-mq-qimport.out @@ -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