Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/subrepo.py Fri Jan 15 13:14:50 2016 -0800 +++ b/mercurial/subrepo.py Fri Jan 15 13:14:50 2016 -0800 @@ -631,11 +631,8 @@ self._initrepo(r, state[0], create) def storeclean(self, path): - lock = self._repo.lock() - try: + with self._repo.lock(): return self._storeclean(path) - finally: - lock.release() def _storeclean(self, path): clean = True