Mercurial > hg
changeset 8398:a45eb410e0f2
commitctx: simplify locking
(spotted by Simon Heimberg)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 14 May 2009 13:20:40 -0500 |
parents | 613ac2856535 |
children | 1c3d5c54cf1c |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu May 14 13:20:40 2009 -0500 +++ b/mercurial/localrepo.py Thu May 14 13:20:40 2009 -0500 @@ -830,15 +830,13 @@ Revision information is passed in the context.memctx argument. commitctx() does not touch the working directory. """ - wlock = lock = None + lock = self.lock() try: - wlock = self.wlock() - lock = self.lock() return self._commitctx(ctx, force=True, force_editor=False, empty_ok=True, use_dirstate=False, update_dirstate=False) finally: - release(lock, wlock) + lock.release() def _commitctx(self, wctx, force=False, force_editor=False, empty_ok=False, use_dirstate=True, update_dirstate=True):