# HG changeset patch # User Siddharth Agarwal # Date 2015-09-24 22:57:11 # Node ID 927fa07a2ba40764072043689ba53392c6832537 # Parent f51713b8c6fa33919b14f25ee73d030915dbf480 lock: introduce state to keep track of inheritance This is part of a series that will allow locks to be inherited by subprocesses in limited circumstances. In upcoming patches we will refer to this state. diff --git a/mercurial/lock.py b/mercurial/lock.py --- a/mercurial/lock.py +++ b/mercurial/lock.py @@ -39,7 +39,7 @@ class lock(object): _host = None def __init__(self, vfs, file, timeout=-1, releasefn=None, acquirefn=None, - desc=None): + desc=None, parentlock=None): self.vfs = vfs self.f = file self.held = 0 @@ -47,6 +47,9 @@ class lock(object): self.releasefn = releasefn self.acquirefn = acquirefn self.desc = desc + self.parentlock = parentlock + self._parentheld = False + self._inherited = False self.postrelease = [] self.pid = os.getpid() self.delay = self.lock()