# HG changeset patch # User Na'Tosha Bard # Date 2012-01-18 12:41:03 # Node ID c35dcde25174891e94fb91544ec9e98979fb47c3 # Parent 2bd54ffaa27e6d40f619643338c9aff9416acc86 largefiles: refactor lfutil.findfiles to be more logical diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py +++ b/hgext/largefiles/lfutil.py @@ -117,14 +117,14 @@ def inusercache(ui, hash): 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):