changeset 27858:7575c048482d

with: use context manager in manifest
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 15 Jan 2016 13:14:49 -0800
parents b0b98e0a12f8
children f55a5ace8e69
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Jan 15 13:14:49 2016 -0800
+++ b/mercurial/commands.py	Fri Jan 15 13:14:49 2016 -0800
@@ -5118,13 +5118,10 @@
         suffix = ".i"
         plen = len(prefix)
         slen = len(suffix)
-        lock = repo.lock()
-        try:
+        with repo.lock():
             for fn, b, size in repo.store.datafiles():
                 if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix:
                     res.append(fn[plen:-slen])
-        finally:
-            lock.release()
         for f in res:
             fm.startitem()
             fm.write("path", '%s\n', f)