# HG changeset patch # User Matt Mackall # Date 1242325240 18000 # Node ID a45eb410e0f2d45a7ae37715c9b05fc25269e26c # Parent 613ac2856535cde91e809ef22a35aabbfc9bf5d9 commitctx: simplify locking (spotted by Simon Heimberg) diff -r 613ac2856535 -r a45eb410e0f2 mercurial/localrepo.py --- 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):