diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1583,7 +1583,7 @@ class queue: text = sys.stdin.read() else: text = url.open(self.ui, filename).read() - except IOError: + except (OSError, IOError): raise util.Abort(_("unable to read %s") % filename) if not patchname: patchname = normname(os.path.basename(filename)) diff --git a/tests/test-mq-qimport b/tests/test-mq-qimport --- a/tests/test-mq-qimport +++ b/tests/test-mq-qimport @@ -25,7 +25,7 @@ hg init repo cd repo echo % qimport non-existing-file -hg qimport non-existing-file 2>&1 | sed -e 's/\(No such file or directory:\) .*/\1/' +hg qimport non-existing-file echo % import URL echo foo >> foo 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: No such file or directory: +abort: unable to read non-existing-file % import URL adding url.diff to series file url.diff