diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -525,8 +525,14 @@ class hgsubrepo(abstractsubrepo): self._initrepo(r, state[0], create) def storeclean(self, path): + lock = self._repo.lock() + try: + return self._storeclean(path) + finally: + lock.release() + + def _storeclean(self, path): clean = True - lock = self._repo.lock() itercache = self._calcstorehash(path) try: for filehash in self._readstorehashcache(path): @@ -543,7 +549,6 @@ class hgsubrepo(abstractsubrepo): clean = False except StopIteration: pass - lock.release() return clean def _calcstorehash(self, remotepath):