comparison mercurial/context.py @ 6286:90a4329a6b4a

filectx.ancestor: use fctx._repopath to cache filelogs (issue1035) _repopath may be different from _path for workingfilectx when there are renames involved.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 16 Mar 2008 06:10:47 -0300
parents c0c4c7b1e8d3
children fb502719c75c a7582980d654
comparison
equal deleted inserted replaced
6285:4b81eecc8aa2 6286:90a4329a6b4a
188 self._filenode = self._changectx.filenode(self._path) 188 self._filenode = self._changectx.filenode(self._path)
189 return self._filenode 189 return self._filenode
190 elif name == '_filerev': 190 elif name == '_filerev':
191 self._filerev = self._filelog.rev(self._filenode) 191 self._filerev = self._filelog.rev(self._filenode)
192 return self._filerev 192 return self._filerev
193 elif name == '_repopath':
194 self._repopath = self._path
195 return self._repopath
193 else: 196 else:
194 raise AttributeError, name 197 raise AttributeError, name
195 198
196 def __nonzero__(self): 199 def __nonzero__(self):
197 try: 200 try:
402 for c in (self, fc2): 405 for c in (self, fc2):
403 if c._filerev == None: 406 if c._filerev == None:
404 pl = [(n.path(), n.filenode()) for n in c.parents()] 407 pl = [(n.path(), n.filenode()) for n in c.parents()]
405 acache[(c._path, None)] = pl 408 acache[(c._path, None)] = pl
406 409
407 flcache = {self._path:self._filelog, fc2._path:fc2._filelog} 410 flcache = {self._repopath:self._filelog, fc2._repopath:fc2._filelog}
408 def parents(vertex): 411 def parents(vertex):
409 if vertex in acache: 412 if vertex in acache:
410 return acache[vertex] 413 return acache[vertex]
411 f, n = vertex 414 f, n = vertex
412 if f not in flcache: 415 if f not in flcache: