largefiles: refactoring - use findfile in localstore._getfile
authorMads Kiilerich <madski@unity3d.com>
Mon, 15 Apr 2013 23:35:43 +0200
changeset 19000 eaf146e811a4
parent 18999 c1b5f9c4d989
child 19001 2a35296a6304
largefiles: refactoring - use findfile in localstore._getfile
hgext/largefiles/localstore.py
--- a/hgext/largefiles/localstore.py	Mon Apr 15 23:35:18 2013 +0200
+++ b/hgext/largefiles/localstore.py	Mon Apr 15 23:35:43 2013 +0200
@@ -36,11 +36,8 @@
 
 
     def _getfile(self, tmpfile, filename, hash):
-        if lfutil.instore(self.remote, hash):
-            path = lfutil.storepath(self.remote, hash)
-        elif lfutil.inusercache(self.ui, hash):
-            path = lfutil.usercachepath(self.ui, hash)
-        else:
+        path = lfutil.findfile(self.remote, hash)
+        if not path:
             raise basestore.StoreError(filename, hash, self.url,
                 _("can't get file locally"))
         fd = open(path, 'rb')