Catch urllib errors for old-http in a nicer way.
--- a/mercurial/statichttprepo.py Wed Mar 01 14:52:28 2006 +0100
+++ b/mercurial/statichttprepo.py Wed Mar 01 15:29:13 2006 +0100
@@ -15,8 +15,10 @@
def read(self, size=None):
try:
return httprangereader.httprangereader.read(self, size)
+ except urllib2.HTTPError, inst:
+ raise IOError(None, inst)
except urllib2.URLError, inst:
- raise IOError(None, str(inst))
+ raise IOError(None, inst.reason[1])
def opener(base):
"""return a function that opens files over http"""
--- a/tests/test-static-http.out Wed Mar 01 14:52:28 2006 +0100
+++ b/tests/test-static-http.out Wed Mar 01 15:29:13 2006 +0100
@@ -1,4 +1,4 @@
-abort: <urlopen error (111, 'Connection refused')>
+abort: Connection refused
255
ls: copy: No such file or directory
changeset: 0:61c9426e69fe