hgext/largefiles/remotestore.py
branchstable
changeset 18484 d43823f928fe
parent 18482 6f219eb83435
child 18573 003730ca254d
equal deleted inserted replaced
18483:ce5f529deb36 18484:d43823f928fe
    46             if fd:
    46             if fd:
    47                 fd.close()
    47                 fd.close()
    48 
    48 
    49     def _getfile(self, tmpfile, filename, hash):
    49     def _getfile(self, tmpfile, filename, hash):
    50         # quit if the largefile isn't there
    50         # quit if the largefile isn't there
    51         stat = self._stat(hash)
    51         stat = self._stat([hash])[hash]
    52         if stat == 1:
    52         if stat == 1:
    53             raise util.Abort(_('remotestore: largefile %s is invalid') % hash)
    53             raise util.Abort(_('remotestore: largefile %s is invalid') % hash)
    54         elif stat == 2:
    54         elif stat == 2:
    55             raise util.Abort(_('remotestore: largefile %s is missing') % hash)
    55             raise util.Abort(_('remotestore: largefile %s is missing') % hash)
       
    56         elif stat != 0:
       
    57             raise RuntimeError('error getting file: unexpected response from '
       
    58                                'statlfile (%r)' % stat)
    56 
    59 
    57         try:
    60         try:
    58             length, infile = self._get(hash)
    61             length, infile = self._get(hash)
    59         except urllib2.HTTPError, e:
    62         except urllib2.HTTPError, e:
    60             # 401s get converted to util.Aborts; everything else is fine being
    63             # 401s get converted to util.Aborts; everything else is fine being