Mercurial > public > mercurial-scm > hg
diff hgext/largefiles/reposetup.py @ 27842:002108b219e3
with: use context manager in largefiles commit
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Fri, 15 Jan 2016 13:14:50 -0800 |
parents | 56b2bcea2529 |
children | 5c14af475f61 |
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py Fri Jan 15 13:14:50 2016 -0800 +++ b/hgext/largefiles/reposetup.py Fri Jan 15 13:14:50 2016 -0800 @@ -263,15 +263,12 @@ 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():