Comments
Patch
@@ -551,11 +551,6 @@ class hgsubrepo(abstractsubrepo):
yield '%s = %s\n' % (relname,
util.sha1(vfs.tryread(relname)).hexdigest())
- def _getstorehashcachepath(self, remotepath):
- '''get a unique path for the store hash cache'''
- return self._repo.join(os.path.join(
- 'cache', 'storehash', _getstorehashcachename(remotepath)))
-
@propertycache
def _cachestorehashvfs(self):
return scmutil.vfs(self._repo.join('cache/storehash'))
@@ -571,15 +566,11 @@ class hgsubrepo(abstractsubrepo):
Each remote repo requires its own store hash cache, because a subrepo
store may be "clean" versus a given remote repo, but not versus another
'''
- cachefile = self._getstorehashcachepath(remotepath)
+ cachefile = _getstorehashcachename(remotepath)
lock = self._repo.lock()
storehash = list(self._calcstorehash(remotepath))
- cachedir = os.path.dirname(cachefile)
- if not os.path.exists(cachedir):
- util.makedirs(cachedir, notindexed=True)
- fd = open(cachefile, 'w')
- fd.writelines(storehash)
- fd.close()
+ vfs = self._cachestorehashvfs
+ vfs.writelines(cachefile, storehash, mode='w', notindexed=True)
lock.release()
@annotatesubrepoerror