comparison mercurial/context.py @ 19697:8c95e74857c6

commitablectx: move walk from workingctx
author Sean Farley <sean.michael.farley@gmail.com>
date Wed, 14 Aug 2013 16:37:11 -0500
parents 210cc42a8ac2
children 8d4a8f4eb404
comparison
equal deleted inserted replaced
19696:210cc42a8ac2 19697:8c95e74857c6
1032 1032
1033 def ancestor(self, c2): 1033 def ancestor(self, c2):
1034 """return the ancestor context of self and c2""" 1034 """return the ancestor context of self and c2"""
1035 return self._parents[0].ancestor(c2) # punt on two parents for now 1035 return self._parents[0].ancestor(c2) # punt on two parents for now
1036 1036
1037 def walk(self, match):
1038 return sorted(self._repo.dirstate.walk(match, sorted(self.substate),
1039 True, False))
1040
1037 class workingctx(commitablectx): 1041 class workingctx(commitablectx):
1038 """A workingctx object makes access to data related to 1042 """A workingctx object makes access to data related to
1039 the current working directory convenient. 1043 the current working directory convenient.
1040 date - any valid date string or (unixtime, offset), or None. 1044 date - any valid date string or (unixtime, offset), or None.
1041 user - username string, or None. 1045 user - username string, or None.
1062 1066
1063 def filectx(self, path, filelog=None): 1067 def filectx(self, path, filelog=None):
1064 """get a file context from the working directory""" 1068 """get a file context from the working directory"""
1065 return workingfilectx(self._repo, path, workingctx=self, 1069 return workingfilectx(self._repo, path, workingctx=self,
1066 filelog=filelog) 1070 filelog=filelog)
1067
1068 def walk(self, match):
1069 return sorted(self._repo.dirstate.walk(match, sorted(self.substate),
1070 True, False))
1071 1071
1072 def dirty(self, missing=False, merge=True, branch=True): 1072 def dirty(self, missing=False, merge=True, branch=True):
1073 "check whether a working directory is modified" 1073 "check whether a working directory is modified"
1074 # check subrepos first 1074 # check subrepos first
1075 for s in sorted(self.substate): 1075 for s in sorted(self.substate):