changeset 19000:eaf146e811a4

largefiles: refactoring - use findfile in localstore._getfile
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Apr 2013 23:35:43 +0200
parents c1b5f9c4d989
children 2a35296a6304
files hgext/largefiles/localstore.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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')