comparison mercurial/subrepo.py @ 27844:469b86c49503

with: use context manager in subrepo storeclean
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 15 Jan 2016 13:14:50 -0800
parents b2efdb66c406
children 594bdc380aa2
comparison
equal deleted inserted replaced
27843:b2efdb66c406 27844:469b86c49503
629 # internal config: ui._usedassubrepo 629 # internal config: ui._usedassubrepo
630 self.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo') 630 self.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo')
631 self._initrepo(r, state[0], create) 631 self._initrepo(r, state[0], create)
632 632
633 def storeclean(self, path): 633 def storeclean(self, path):
634 lock = self._repo.lock() 634 with self._repo.lock():
635 try:
636 return self._storeclean(path) 635 return self._storeclean(path)
637 finally:
638 lock.release()
639 636
640 def _storeclean(self, path): 637 def _storeclean(self, path):
641 clean = True 638 clean = True
642 itercache = self._calcstorehash(path) 639 itercache = self._calcstorehash(path)
643 for filehash in self._readstorehashcache(path): 640 for filehash in self._readstorehashcache(path):