comparison mercurial/context.py @ 19698:8d4a8f4eb404

commitablectx: move ancestors from workingctx
author Sean Farley <sean.michael.farley@gmail.com>
date Wed, 14 Aug 2013 16:37:59 -0500
parents 8c95e74857c6
children 9fbc193b2358
comparison
equal deleted inserted replaced
19697:8c95e74857c6 19698:8d4a8f4eb404
1036 1036
1037 def walk(self, match): 1037 def walk(self, match):
1038 return sorted(self._repo.dirstate.walk(match, sorted(self.substate), 1038 return sorted(self._repo.dirstate.walk(match, sorted(self.substate),
1039 True, False)) 1039 True, False))
1040 1040
1041 def ancestors(self):
1042 for a in self._repo.changelog.ancestors(
1043 [p.rev() for p in self._parents]):
1044 yield changectx(self._repo, a)
1045
1041 class workingctx(commitablectx): 1046 class workingctx(commitablectx):
1042 """A workingctx object makes access to data related to 1047 """A workingctx object makes access to data related to
1043 the current working directory convenient. 1048 the current working directory convenient.
1044 date - any valid date string or (unixtime, offset), or None. 1049 date - any valid date string or (unixtime, offset), or None.
1045 user - username string, or None. 1050 user - username string, or None.
1131 self._repo.dirstate.drop(f) 1136 self._repo.dirstate.drop(f)
1132 return rejected 1137 return rejected
1133 finally: 1138 finally:
1134 wlock.release() 1139 wlock.release()
1135 1140
1136 def ancestors(self):
1137 for a in self._repo.changelog.ancestors(
1138 [p.rev() for p in self._parents]):
1139 yield changectx(self._repo, a)
1140
1141 def undelete(self, list): 1141 def undelete(self, list):
1142 pctxs = self.parents() 1142 pctxs = self.parents()
1143 wlock = self._repo.wlock() 1143 wlock = self._repo.wlock()
1144 try: 1144 try:
1145 for f in list: 1145 for f in list: