mercurial/context.py
changeset 19572 c19f46b904b9
parent 19571 103edf3ed79e
child 19573 dffad92ab709
equal deleted inserted replaced
19571:103edf3ed79e 19572:c19f46b904b9
   407                 # specified pattern is a directory
   407                 # specified pattern is a directory
   408                 continue
   408                 continue
   409             if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
   409             if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
   410                 yield fn
   410                 yield fn
   411 
   411 
   412 class filectx(object):
   412 class basefilectx(object):
       
   413     """A filecontext object represents the common logic for its children:
       
   414     filectx: read-only access to a filerevision that is already present
       
   415              in the repo,
       
   416     workingfilectx: a filecontext that represents files from the working
       
   417                     directory,
       
   418     memfilectx: a filecontext that represents files in-memory."""
       
   419     def __new__(cls, repo, path, *args, **kwargs):
       
   420         return super(basefilectx, cls).__new__(cls)
       
   421 
       
   422 class filectx(basefilectx):
   413     """A filecontext object makes access to data related to a particular
   423     """A filecontext object makes access to data related to a particular
   414        filerevision convenient."""
   424        filerevision convenient."""
   415     def __init__(self, repo, path, changeid=None, fileid=None,
   425     def __init__(self, repo, path, changeid=None, fileid=None,
   416                  filelog=None, changectx=None):
   426                  filelog=None, changectx=None):
   417         """changeid can be a changeset revision, node, or tag.
   427         """changeid can be a changeset revision, node, or tag.