Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 1325:57220daf40e9
Move urllib error handling from revlog into statichttprepo, where it belongs.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Fri, 23 Sep 2005 00:05:16 -0700 |
parents | b3d44e9b3092 |
children | 0e2be889ccd7 |
comparison
equal
deleted
inserted
replaced
1323:60200b3fc839 | 1325:57220daf40e9 |
---|---|
10 of the GNU General Public License, incorporated herein by reference. | 10 of the GNU General Public License, incorporated herein by reference. |
11 """ | 11 """ |
12 | 12 |
13 from node import * | 13 from node import * |
14 from demandload import demandload | 14 from demandload import demandload |
15 demandload(globals(), "binascii errno heapq mdiff sha struct urllib2 zlib") | 15 demandload(globals(), "binascii errno heapq mdiff sha struct zlib") |
16 | 16 |
17 def hash(text, p1, p2): | 17 def hash(text, p1, p2): |
18 """generate a hash from the given text and its parent hashes | 18 """generate a hash from the given text and its parent hashes |
19 | 19 |
20 This hash combines both the current file contents and its history | 20 This hash combines both the current file contents and its history |
177 self.opener = opener | 177 self.opener = opener |
178 self.cache = None | 178 self.cache = None |
179 | 179 |
180 try: | 180 try: |
181 i = self.opener(self.indexfile).read() | 181 i = self.opener(self.indexfile).read() |
182 except urllib2.URLError: | |
183 raise | |
184 except IOError, inst: | 182 except IOError, inst: |
185 if inst.errno != errno.ENOENT: | 183 if inst.errno != errno.ENOENT: |
186 raise | 184 raise |
187 i = "" | 185 i = "" |
188 | 186 |