comparison mercurial/context.py @ 9843:d1043c2ffe6c

merge: fix changectx.ancestor(workingctx) (issue1327)
author Matt Mackall <mpm@selenic.com>
date Thu, 12 Nov 2009 12:03:39 -0600
parents f8ca4035a949
children d1319ad5071b eb243551cbd8
comparison
equal deleted inserted replaced
9842:d3dbdca92458 9843:d1043c2ffe6c
162 162
163 def ancestor(self, c2): 163 def ancestor(self, c2):
164 """ 164 """
165 return the ancestor context of self and c2 165 return the ancestor context of self and c2
166 """ 166 """
167 n = self._repo.changelog.ancestor(self._node, c2._node) 167 # deal with workingctxs
168 n2 = c2._node
169 if n2 == None:
170 n2 = c2._parents[0]._node
171 n = self._repo.changelog.ancestor(self._node, n2)
168 return changectx(self._repo, n) 172 return changectx(self._repo, n)
169 173
170 def walk(self, match): 174 def walk(self, match):
171 fset = set(match.files()) 175 fset = set(match.files())
172 # for dirstate.walk, files=['.'] means "walk the whole tree". 176 # for dirstate.walk, files=['.'] means "walk the whole tree".