diff mercurial/scmutil.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 89f0d9f87701
children 10284ce3d5ed
line wrap: on
line diff
--- a/mercurial/scmutil.py	Thu Sep 17 22:34:36 2020 -0700
+++ b/mercurial/scmutil.py	Fri Sep 18 08:27:43 2020 -0700
@@ -1737,29 +1737,6 @@
     return data
 
 
-def _locksub(repo, lock, envvar, cmd, environ=None, *args, **kwargs):
-    if lock is None:
-        raise error.LockInheritanceContractViolation(
-            b'lock can only be inherited while held'
-        )
-    if environ is None:
-        environ = {}
-    with lock.inherit() as locker:
-        environ[envvar] = locker
-        return repo.ui.system(cmd, environ=environ, *args, **kwargs)
-
-
-def wlocksub(repo, cmd, *args, **kwargs):
-    """run cmd as a subprocess that allows inheriting repo's wlock
-
-    This can only be called while the wlock is held. This takes all the
-    arguments that ui.system does, and returns the exit code of the
-    subprocess."""
-    return _locksub(
-        repo, repo.currentwlock(), b'HG_WLOCK_LOCKER', cmd, *args, **kwargs
-    )
-
-
 class progress(object):
     def __init__(self, ui, updatebar, topic, unit=b"", total=None):
         self.ui = ui