diff mercurial/localrepo.py @ 45519:9b16bb3b2349

locking: remove support for inheriting locks in subprocess This seems to have been added for merge driver, and since merge driver is now gone... Differential Revision: https://phab.mercurial-scm.org/D9053
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 18 Sep 2020 08:27:43 -0700
parents a8843eda9a35
children 88a47cbf063c
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Sep 17 22:34:36 2020 -0700
+++ b/mercurial/localrepo.py	Fri Sep 18 08:27:43 2020 -0700
@@ -2678,22 +2678,8 @@
             ce.refresh()
 
     def _lock(
-        self,
-        vfs,
-        lockname,
-        wait,
-        releasefn,
-        acquirefn,
-        desc,
-        inheritchecker=None,
-        parentenvvar=None,
+        self, vfs, lockname, wait, releasefn, acquirefn, desc,
     ):
-        parentlock = None
-        # the contents of parentenvvar are used by the underlying lock to
-        # determine whether it can be inherited
-        if parentenvvar is not None:
-            parentlock = encoding.environ.get(parentenvvar)
-
         timeout = 0
         warntimeout = 0
         if wait:
@@ -2711,8 +2697,6 @@
             releasefn=releasefn,
             acquirefn=acquirefn,
             desc=desc,
-            inheritchecker=inheritchecker,
-            parentlock=parentlock,
             signalsafe=signalsafe,
         )
         return l
@@ -2753,12 +2737,6 @@
         self._lockref = weakref.ref(l)
         return l
 
-    def _wlockchecktransaction(self):
-        if self.currenttransaction() is not None:
-            raise error.LockInheritanceContractViolation(
-                b'wlock cannot be inherited in the middle of a transaction'
-            )
-
     def wlock(self, wait=True):
         '''Lock the non-store parts of the repository (everything under
         .hg except .hg/store) and return a weak reference to the lock.
@@ -2796,8 +2774,6 @@
             unlock,
             self.invalidatedirstate,
             _(b'working directory of %s') % self.origroot,
-            inheritchecker=self._wlockchecktransaction,
-            parentenvvar=b'HG_WLOCK_LOCKER',
         )
         self._wlockref = weakref.ref(l)
         return l