Patchwork [03,of,13] largefiles: refactoring - use findfile in localstore._getfile

login
register
mail settings
Submitter Mads Kiilerich
Date April 16, 2013, 2:43 a.m.
Message ID <889ccb073d7e346d761c.1366080200@mk-desktop>
Download mbox | patch
Permalink /patch/1331/
State Accepted
Commit eaf146e811a44af12b3a9cbf053117d142f258e4
Headers show

Comments

Mads Kiilerich - April 16, 2013, 2:43 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1366061743 -7200
#      Mon Apr 15 23:35:43 2013 +0200
# Node ID 889ccb073d7e346d761c6487f00003cf825edad9
# Parent  d36db32a4352b2d97d9b2bd0089789f83a623e84
largefiles: refactoring - use findfile in localstore._getfile

Patch

diff --git a/hgext/largefiles/localstore.py b/hgext/largefiles/localstore.py
--- a/hgext/largefiles/localstore.py
+++ b/hgext/largefiles/localstore.py
@@ -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')