mercurial/context.py
changeset 19537 6e3e8575276d
parent 19314 bc82abe500a9
child 19538 049d6b5a4a59
equal deleted inserted replaced
19536:ab3cf67740d6 19537:6e3e8575276d
    14 import obsolete as obsmod
    14 import obsolete as obsmod
    15 import repoview
    15 import repoview
    16 
    16 
    17 propertycache = util.propertycache
    17 propertycache = util.propertycache
    18 
    18 
    19 class changectx(object):
    19 class basectx(object):
       
    20     """A basectx object represents the common logic for its children:
       
    21     changectx: read-only context that is already present in the repo,
       
    22     workingctx: a context that represents the working directory and can
       
    23                 be committed,
       
    24     memctx: a context that represents changes in-memory and can also
       
    25             be committed."""
       
    26     def __new__(cls, repo, changeid='', *args, **kwargs):
       
    27         return super(basectx, cls).__new__(cls)
       
    28 
       
    29 class changectx(basectx):
    20     """A changecontext object makes access to data related to a particular
    30     """A changecontext object makes access to data related to a particular
    21     changeset convenient."""
    31     changeset convenient. It represents a read-only context already presnt in
       
    32     the repo."""
    22     def __init__(self, repo, changeid=''):
    33     def __init__(self, repo, changeid=''):
    23         """changeid is a revision number, node, or tag"""
    34         """changeid is a revision number, node, or tag"""
    24         if changeid == '':
    35         if changeid == '':
    25             changeid = '.'
    36             changeid = '.'
    26         self._repo = repo
    37         self._repo = repo