Mercurial > hg > mercurial-crew
diff mercurial/commands.py @ 28513:7575c048482d
with: use context manager in manifest
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 15 Jan 2016 13:14:49 -0800 (2016-01-15) |
parents | b0b98e0a12f8 |
children | acfe40eb8cb5 |
line wrap: on
line diff
--- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -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)