original_docstring: context for the lock to be inherited by a Mercurial subprocess.
  
          Yields a string that will be recognized by the lock in the subprocess.
          Communicating this string to the subprocess needs to be done separately
          -- typically by an environment variable.
          
docstring: context for the lock to be inherited by a Mercurial subprocess.
  Yields a string that will be recognized by the lock in the subprocess.
  Communicating this string to the subprocess needs to be done separately
  typically by an environment variable.
docstring_tokens: context for the lock to be inherited by a Mercurial subprocess . Yields a string that will be recognized by the lock in the subprocess . Communicating this string to the subprocess needs to be done separately typically by an environment variable .
code: def inherit(self):
          """context for the lock to be inherited by a Mercurial subprocess.
  
          Yields a string that will be recognized by the lock in the subprocess.
          Communicating this string to the subprocess needs to be done separately
          -- typically by an environment variable.
          """
          if not self.held:
              raise error.LockInheritanceContractViolation(
                  'inherit can only be called while lock is held')
          if self._inherited:
              raise error.LockInheritanceContractViolation(
                  'inherit cannot be called while lock is already inherited')
          if self._inheritchecker is not None:
              self._inheritchecker()
          if self.releasefn:
              self.releasefn()
          if self._parentheld:
              lockname = self.parentlock
          else:
              lockname = '%s:%s' % (lock._host, self.pid)
          self._inherited = True
          try:
              yield lockname
          finally:
              if self.acquirefn:
                  self.acquirefn()
              self._inherited = False
code_tokens: def inherit ( self ) : if not self . held : raise error . LockInheritanceContractViolation ( 'inherit can only be called while lock is held' ) if self . _inherited : raise error . LockInheritanceContractViolation ( 'inherit cannot be called while lock is already inherited' ) if self . _inheritchecker is not None : self . _inheritchecker ( ) if self . releasefn : self . releasefn ( ) if self . _parentheld : lockname = self . parentlock else : lockname = '%s:%s' % ( lock . _host , self . pid ) self . _inherited = True try : yield lockname finally : if self . acquirefn : self . acquirefn ( ) self . _inherited = False
short_docstring: context for the lock to be inherited by a Mercurial subprocess.
short_docstring_tokens: context for the lock to be inherited by a Mercurial subprocess .
comment: """context for the lock to be inherited by a Mercurial subprocess.
  
          Yields a string that will be recognized by the lock in the subprocess.
          Communicating this string to the subprocess needs to be done separately
          -- typically by an environment variable.
          """