hgext/largefiles/lfutil.py
branchstable
changeset 15317 41f371150ccb
parent 15316 c65f5b6e26d4
child 15319 9da7e96cd5c2
--- a/hgext/largefiles/lfutil.py	Thu Oct 20 13:24:09 2011 -0400
+++ b/hgext/largefiles/lfutil.py	Thu Oct 20 13:24:11 2011 -0400
@@ -100,11 +100,12 @@
 def findfile(repo, hash):
     if instore(repo, hash):
         repo.ui.note(_('Found %s in store\n') % hash)
-        return storepath(repo, hash)
-    if inusercache(repo.ui, hash):
+    elif inusercache(repo.ui, hash):
         repo.ui.note(_('Found %s in system cache\n') % hash)
-        return usercachepath(repo.ui, hash)
-    return None
+        link(usercachepath(repo.ui, hash), storepath(repo, hash))
+    else:
+        return None
+    return storepath(repo, hash)
 
 class largefiles_dirstate(dirstate.dirstate):
     def __getitem__(self, key):