mercurial/subrepo.py
changeset 23372 6cfa7a73b6e7
parent 23369 22e00674d17e
child 23373 99a886418000
equal deleted inserted replaced
23371:1df6519eb3ab 23372:6cfa7a73b6e7
   579         '''cache the current store hash
   579         '''cache the current store hash
   580 
   580 
   581         Each remote repo requires its own store hash cache, because a subrepo
   581         Each remote repo requires its own store hash cache, because a subrepo
   582         store may be "clean" versus a given remote repo, but not versus another
   582         store may be "clean" versus a given remote repo, but not versus another
   583         '''
   583         '''
   584         cachefile = self._getstorehashcachepath(remotepath)
   584         cachefile = _getstorehashcachename(remotepath)
   585         lock = self._repo.lock()
   585         lock = self._repo.lock()
   586         try:
   586         try:
   587             storehash = list(self._calcstorehash(remotepath))
   587             storehash = list(self._calcstorehash(remotepath))
   588             cachedir = os.path.dirname(cachefile)
   588             vfs = self._cachestorehashvfs
   589             if not os.path.exists(cachedir):
   589             vfs.writelines(cachefile, storehash, mode='w', notindexed=True)
   590                 util.makedirs(cachedir, notindexed=True)
       
   591             fd = open(cachefile, 'w')
       
   592             try:
       
   593                 fd.writelines(storehash)
       
   594             finally:
       
   595                 fd.close()
       
   596         finally:
   590         finally:
   597             lock.release()
   591             lock.release()
   598 
   592 
   599     @annotatesubrepoerror
   593     @annotatesubrepoerror
   600     def _initrepo(self, parentrepo, source, create):
   594     def _initrepo(self, parentrepo, source, create):