# HG changeset patch # User Bryan O'Sullivan # Date 1452892490 28800 # Node ID 469b86c49503320654ba58610cf49f7425ef35dd # Parent b2efdb66c4069f7dffb612898b651fbe0ff0f494 with: use context manager in subrepo storeclean diff -r b2efdb66c406 -r 469b86c49503 mercurial/subrepo.py --- 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