Catch both IOError and OSError, fix regression introduced by
8046f0a070a6
--- a/hgext/mq.py Tue Nov 25 18:45:08 2008 -0800
+++ b/hgext/mq.py Wed Nov 26 18:23:35 2008 +0100
@@ -1583,7 +1583,7 @@
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))
--- a/tests/test-mq-qimport Tue Nov 25 18:45:08 2008 -0800
+++ b/tests/test-mq-qimport Wed Nov 26 18:23:35 2008 +0100
@@ -25,7 +25,7 @@
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
--- a/tests/test-mq-qimport.out Tue Nov 25 18:45:08 2008 -0800
+++ b/tests/test-mq-qimport.out Wed Nov 26 18:23:35 2008 +0100
@@ -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