Mercurial > hg-stable
changeset 1328:04ed65045bcc
Merge with myself.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Fri, 23 Sep 2005 07:41:25 -0700 |
parents | 085e3fc189b6 (current diff) 76b2c7096d08 (diff) |
children | 8f06817bf266 |
files | |
diffstat | 3 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Sep 23 07:36:30 2005 -0700 +++ b/mercurial/commands.py Fri Sep 23 07:41:25 2005 -0700 @@ -2160,6 +2160,8 @@ u.warn("abort: %s\n" % inst) elif hasattr(inst, "reason"): u.warn("abort: error: %s\n" % inst.reason[1]) + elif getattr(inst, "strerror", None): + u.warn("abort: %s\n" % inst.strerror) elif hasattr(inst, "args") and inst[0] == errno.EPIPE: if u.debugflag: u.warn("broken pipe\n")
--- a/mercurial/revlog.py Fri Sep 23 07:36:30 2005 -0700 +++ b/mercurial/revlog.py Fri Sep 23 07:41:25 2005 -0700 @@ -12,7 +12,7 @@ from node import * from demandload import demandload -demandload(globals(), "binascii errno heapq mdiff sha struct urllib2 zlib") +demandload(globals(), "binascii errno heapq mdiff sha struct zlib") def hash(text, p1, p2): """generate a hash from the given text and its parent hashes @@ -179,8 +179,6 @@ try: i = self.opener(self.indexfile).read() - except urllib2.URLError: - raise except IOError, inst: if inst.errno != errno.ENOENT: raise
--- a/mercurial/statichttprepo.py Fri Sep 23 07:36:30 2005 -0700 +++ b/mercurial/statichttprepo.py Fri Sep 23 07:41:25 2005 -0700 @@ -7,15 +7,23 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -import os, urllib -import localrepo, httprangereader, filelog, manifest, changelog +from demandload import demandload +demandload(globals(), "changelog filelog httprangereader") +demandload(globals(), "localrepo manifest os urllib urllib2") + +class rangereader(httprangereader.httprangereader): + def read(self, size=None): + try: + return httprangereader.httprangereader.read(self, size) + except urllib2.URLError, inst: + raise IOError(None, str(inst)) def opener(base): """return a function that opens files over http""" p = base def o(path, mode="r"): f = os.path.join(p, urllib.quote(path)) - return httprangereader.httprangereader(f) + return rangereader(f) return o class statichttprepository(localrepo.localrepository):