mercurial/subrepo.py
changeset 21885 fe9db58b0b2d
parent 21585 652e07debf10
child 21886 b9e8fdc35daf
equal deleted inserted replaced
21884:a858d3de0d32 21885:fe9db58b0b2d
   523                 self._repo.ui.setconfig(s, k, v, 'subrepo')
   523                 self._repo.ui.setconfig(s, k, v, 'subrepo')
   524         self._repo.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo')
   524         self._repo.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo')
   525         self._initrepo(r, state[0], create)
   525         self._initrepo(r, state[0], create)
   526 
   526 
   527     def storeclean(self, path):
   527     def storeclean(self, path):
       
   528         lock = self._repo.lock()
       
   529         try:
       
   530             return self._storeclean(path)
       
   531         finally:
       
   532             lock.release()
       
   533 
       
   534     def _storeclean(self, path):
   528         clean = True
   535         clean = True
   529         lock = self._repo.lock()
       
   530         itercache = self._calcstorehash(path)
   536         itercache = self._calcstorehash(path)
   531         try:
   537         try:
   532             for filehash in self._readstorehashcache(path):
   538             for filehash in self._readstorehashcache(path):
   533                 if filehash != itercache.next():
   539                 if filehash != itercache.next():
   534                     clean = False
   540                     clean = False
   541                 itercache.next()
   547                 itercache.next()
   542                 # the cached and current pull states have a different size
   548                 # the cached and current pull states have a different size
   543                 clean = False
   549                 clean = False
   544             except StopIteration:
   550             except StopIteration:
   545                 pass
   551                 pass
   546         lock.release()
       
   547         return clean
   552         return clean
   548 
   553 
   549     def _calcstorehash(self, remotepath):
   554     def _calcstorehash(self, remotepath):
   550         '''calculate a unique "store hash"
   555         '''calculate a unique "store hash"
   551 
   556