Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 41856:90eddb679521
localrepo: explicit `_lock` arguments in `lock`
The argument for `_lock` are non-trivial, having them passed explicitly makes
thing clearer in my opinion. This is a Gratuitous change, I expect it will save
me (and others) time in the future.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 04 Mar 2019 16:08:44 +0100 |
parents | 688fc33e105d |
children | 94faa2e84094 |
comparison
equal
deleted
inserted
replaced
41855:2dbdb9abcc4b | 41856:90eddb679521 |
---|---|
2222 l = self._currentlock(self._lockref) | 2222 l = self._currentlock(self._lockref) |
2223 if l is not None: | 2223 if l is not None: |
2224 l.lock() | 2224 l.lock() |
2225 return l | 2225 return l |
2226 | 2226 |
2227 l = self._lock(self.svfs, "lock", wait, None, | 2227 l = self._lock(vfs=self.svfs, |
2228 self.invalidate, _('repository %s') % self.origroot) | 2228 lockname="lock", |
2229 wait=wait, | |
2230 releasefn=None, | |
2231 acquirefn=self.invalidate, | |
2232 desc=_('repository %s') % self.origroot) | |
2229 self._lockref = weakref.ref(l) | 2233 self._lockref = weakref.ref(l) |
2230 return l | 2234 return l |
2231 | 2235 |
2232 def _wlockchecktransaction(self): | 2236 def _wlockchecktransaction(self): |
2233 if self.currenttransaction() is not None: | 2237 if self.currenttransaction() is not None: |