Mercurial > public > mercurial-scm > hg
diff mercurial/cmdutil.py @ 27801:7be6371c732e
with: use context manager for wlock in recordinwlock
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 15 Jan 2016 13:14:45 -0800 |
parents | dad6404ccddb |
children | ed44a66fd7ae |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Fri Jan 15 13:14:45 2016 -0800 +++ b/mercurial/cmdutil.py Fri Jan 15 13:14:45 2016 -0800 @@ -230,11 +230,8 @@ pass def recordinwlock(ui, repo, message, match, opts): - wlock = repo.wlock() - try: + with repo.wlock(): return recordfunc(ui, repo, message, match, opts) - finally: - wlock.release() return commit(ui, repo, recordinwlock, pats, opts)