changeset 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 7417e1c10253
files mercurial/subrepo.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
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