113 path = usercachepath(ui, hash) |
113 path = usercachepath(ui, hash) |
114 return path and os.path.exists(path) |
114 return path and os.path.exists(path) |
115 |
115 |
116 def findfile(repo, hash): |
116 def findfile(repo, hash): |
117 if instore(repo, hash): |
117 if instore(repo, hash): |
118 repo.ui.note(_('Found %s in store\n') % hash) |
118 repo.ui.note(_('found %s in store\n') % hash) |
119 return storepath(repo, hash) |
119 return storepath(repo, hash) |
120 elif inusercache(repo.ui, hash): |
120 elif inusercache(repo.ui, hash): |
121 repo.ui.note(_('Found %s in system cache\n') % hash) |
121 repo.ui.note(_('found %s in system cache\n') % hash) |
122 path = storepath(repo, hash) |
122 path = storepath(repo, hash) |
123 util.makedirs(os.path.dirname(path)) |
123 util.makedirs(os.path.dirname(path)) |
124 link(usercachepath(repo.ui, hash), path) |
124 link(usercachepath(repo.ui, hash), path) |
125 return path |
125 return path |
126 return None |
126 return None |