mercurial/context.py
changeset 19668 9d56a3359011
parent 19667 40040e4015f9
child 19669 8120ea4b87f5
equal deleted inserted replaced
19667:40040e4015f9 19668:9d56a3359011
   860         return str(self._parents[0]) + "+"
   860         return str(self._parents[0]) + "+"
   861 
   861 
   862     def __nonzero__(self):
   862     def __nonzero__(self):
   863         return True
   863         return True
   864 
   864 
       
   865     def __contains__(self, key):
       
   866         return self._repo.dirstate[key] not in "?r"
       
   867 
   865 class workingctx(commitablectx):
   868 class workingctx(commitablectx):
   866     """A workingctx object makes access to data related to
   869     """A workingctx object makes access to data related to
   867     the current working directory convenient.
   870     the current working directory convenient.
   868     date - any valid date string or (unixtime, offset), or None.
   871     date - any valid date string or (unixtime, offset), or None.
   869     user - username string, or None.
   872     user - username string, or None.
   872                or None to use the repository status.
   875                or None to use the repository status.
   873     """
   876     """
   874     def __init__(self, repo, text="", user=None, date=None, extra=None,
   877     def __init__(self, repo, text="", user=None, date=None, extra=None,
   875                  changes=None):
   878                  changes=None):
   876         super(workingctx, self).__init__(repo, text, user, date, extra, changes)
   879         super(workingctx, self).__init__(repo, text, user, date, extra, changes)
   877 
       
   878     def __contains__(self, key):
       
   879         return self._repo.dirstate[key] not in "?r"
       
   880 
   880 
   881     def _buildflagfunc(self):
   881     def _buildflagfunc(self):
   882         # Create a fallback function for getting file flags when the
   882         # Create a fallback function for getting file flags when the
   883         # filesystem doesn't support them
   883         # filesystem doesn't support them
   884 
   884