[PATCH] largefiles: refactor lfutil.findfiles to be more logical

Na'Tosha Bard natosha at unity3d.com
Wed Jan 18 07:22:21 CST 2012


# HG changeset patch
# User Na'Tosha Bard <natosha at unity3d.com>
# Date 1326890463 -3600
# Node ID 8560ae7c93a234b8c965b05e08b9a0a91710f6ce
# Parent  476a981fdf341f5bedbd958ca6c8e930fe35b5f9
largefiles: refactor lfutil.findfiles to be more logical

diff -r 476a981fdf34 -r 8560ae7c93a2 hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py	Mon Jan 16 01:21:30 2012 -0600
+++ b/hgext/largefiles/lfutil.py	Wed Jan 18 13:41:03 2012 +0100
@@ -117,14 +117,14 @@
 def findfile(repo, hash):
     if instore(repo, hash):
         repo.ui.note(_('Found %s in store\n') % hash)
+        return storepath(repo, hash)
     elif inusercache(repo.ui, hash):
         repo.ui.note(_('Found %s in system cache\n') % hash)
         path = storepath(repo, hash)
         util.makedirs(os.path.dirname(path))
         link(usercachepath(repo.ui, hash), path)
-    else:
-        return None
-    return storepath(repo, hash)
+        return path
+    return None
 
 class largefiles_dirstate(dirstate.dirstate):
     def __getitem__(self, key):


More information about the Mercurial-devel mailing list