hgext/largefiles/localstore.py
changeset 19000 eaf146e811a4
parent 18998 d035c3902111
child 19002 5083baa6cbf8
equal deleted inserted replaced
18999:c1b5f9c4d989 19000:eaf146e811a4
    34             retval[hash] = lfutil.instore(self.remote, hash)
    34             retval[hash] = lfutil.instore(self.remote, hash)
    35         return retval
    35         return retval
    36 
    36 
    37 
    37 
    38     def _getfile(self, tmpfile, filename, hash):
    38     def _getfile(self, tmpfile, filename, hash):
    39         if lfutil.instore(self.remote, hash):
    39         path = lfutil.findfile(self.remote, hash)
    40             path = lfutil.storepath(self.remote, hash)
    40         if not path:
    41         elif lfutil.inusercache(self.ui, hash):
       
    42             path = lfutil.usercachepath(self.ui, hash)
       
    43         else:
       
    44             raise basestore.StoreError(filename, hash, self.url,
    41             raise basestore.StoreError(filename, hash, self.url,
    45                 _("can't get file locally"))
    42                 _("can't get file locally"))
    46         fd = open(path, 'rb')
    43         fd = open(path, 'rb')
    47         try:
    44         try:
    48             return lfutil.copyandhash(fd, tmpfile)
    45             return lfutil.copyandhash(fd, tmpfile)