# HG changeset patch # User Bryan O'Sullivan # Date 2016-01-15 21:14:50 # Node ID 002108b219e36e1f85f77a94e0530fe8c1b80e92 # Parent 83995fdde2256e67b0a07a836b847a8b24363406 with: use context manager in largefiles commit diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py --- a/hgext/largefiles/reposetup.py +++ b/hgext/largefiles/reposetup.py @@ -263,15 +263,12 @@ def reposetup(ui, repo): force=False, editor=False, extra={}): orig = super(lfilesrepo, self).commit - wlock = self.wlock() - try: + with self.wlock(): lfcommithook = self._lfcommithooks[-1] match = lfcommithook(self, match) result = orig(text=text, user=user, date=date, match=match, force=force, editor=editor, extra=extra) return result - finally: - wlock.release() def push(self, remote, force=False, revs=None, newbranch=False): if remote.local():