comparison hgext/largefiles/remotestore.py @ 15188:8e115063950d

largefiles: don't break existing tests (syntax error, bad imports)
author Greg Ward <greg@gerg.ca>
date Sat, 01 Oct 2011 16:39:51 -0400
parents cfccd3bee7b3
children 6e809bb4f969
comparison
equal deleted inserted replaced
15187:0292f88d3b86 15188:8e115063950d
5 # GNU General Public License version 2 or any later version. 5 # GNU General Public License version 2 or any later version.
6 6
7 '''Remote largefile store; the base class for servestore''' 7 '''Remote largefile store; the base class for servestore'''
8 8
9 import urllib2 9 import urllib2
10 import HTTPError
11 10
12 from mercurial import util 11 from mercurial import util
13 from mercurial.i18n import _ 12 from mercurial.i18n import _
14 13
15 import lfutil 14 import lfutil
55 raise util.Abort(_('remotestore: largefile %s is %s') % 54 raise util.Abort(_('remotestore: largefile %s is %s') %
56 (hash, stat == 1 and 'invalid' or 'missing')) 55 (hash, stat == 1 and 'invalid' or 'missing'))
57 56
58 try: 57 try:
59 length, infile = self._get(hash) 58 length, infile = self._get(hash)
60 except HTTPError, e: 59 except urllib2.HTTPError, e:
61 # 401s get converted to util.Aborts; everything else is fine being 60 # 401s get converted to util.Aborts; everything else is fine being
62 # turned into a StoreError 61 # turned into a StoreError
63 raise basestore.StoreError(filename, hash, self.url, str(e)) 62 raise basestore.StoreError(filename, hash, self.url, str(e))
64 except urllib2.URLError, e: 63 except urllib2.URLError, e:
65 # This usually indicates a connection problem, so don't 64 # This usually indicates a connection problem, so don't