localrepo: explicit `_lock` arguments in `lock`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 04 Mar 2019 16:08:44 +0100
changeset 41856 90eddb679521
parent 41855 2dbdb9abcc4b
child 41857 afd37ed731f1
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.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sun Mar 03 17:22:03 2019 -0800
+++ b/mercurial/localrepo.py	Mon Mar 04 16:08:44 2019 +0100
@@ -2224,8 +2224,12 @@
             l.lock()
             return l
 
-        l = self._lock(self.svfs, "lock", wait, None,
-                       self.invalidate, _('repository %s') % self.origroot)
+        l = self._lock(vfs=self.svfs,
+                       lockname="lock",
+                       wait=wait,
+                       releasefn=None,
+                       acquirefn=self.invalidate,
+                       desc=_('repository %s') % self.origroot)
         self._lockref = weakref.ref(l)
         return l