hgext/largefiles/lfutil.py
changeset 15913 c35dcde25174
parent 15796 3e5b6045ccfc
child 15915 d4c0fa71de01
equal deleted inserted replaced
15912:2bd54ffaa27e 15913:c35dcde25174
   115     return path and os.path.exists(path)
   115     return path and os.path.exists(path)
   116 
   116 
   117 def findfile(repo, hash):
   117 def findfile(repo, hash):
   118     if instore(repo, hash):
   118     if instore(repo, hash):
   119         repo.ui.note(_('Found %s in store\n') % hash)
   119         repo.ui.note(_('Found %s in store\n') % hash)
       
   120         return storepath(repo, hash)
   120     elif inusercache(repo.ui, hash):
   121     elif inusercache(repo.ui, hash):
   121         repo.ui.note(_('Found %s in system cache\n') % hash)
   122         repo.ui.note(_('Found %s in system cache\n') % hash)
   122         path = storepath(repo, hash)
   123         path = storepath(repo, hash)
   123         util.makedirs(os.path.dirname(path))
   124         util.makedirs(os.path.dirname(path))
   124         link(usercachepath(repo.ui, hash), path)
   125         link(usercachepath(repo.ui, hash), path)
   125     else:
   126         return path
   126         return None
   127     return None
   127     return storepath(repo, hash)
       
   128 
   128 
   129 class largefiles_dirstate(dirstate.dirstate):
   129 class largefiles_dirstate(dirstate.dirstate):
   130     def __getitem__(self, key):
   130     def __getitem__(self, key):
   131         return super(largefiles_dirstate, self).__getitem__(unixpath(key))
   131         return super(largefiles_dirstate, self).__getitem__(unixpath(key))
   132     def normal(self, f):
   132     def normal(self, f):