Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 3298:45f0c49f0449
fix workingfilectx parents and ancestor functions
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 09 Oct 2006 21:04:25 -0500 |
parents | 1539f788e913 |
children | 192085505f6f |
comparison
equal
deleted
inserted
replaced
3297:69b9471f26bb | 3298:45f0c49f0449 |
---|---|
412 def __getattr__(self, name): | 412 def __getattr__(self, name): |
413 if name == '_changectx': | 413 if name == '_changectx': |
414 self._changectx = workingctx(repo) | 414 self._changectx = workingctx(repo) |
415 return self._changectx | 415 return self._changectx |
416 elif name == '_repopath': | 416 elif name == '_repopath': |
417 self._repopath = self._repo.dirstate.copied(p) or self._path | 417 self._repopath = (self._repo.dirstate.copied(self._path) |
418 or self._path) | |
419 return self._repopath | |
418 elif name == '_filelog': | 420 elif name == '_filelog': |
419 self._filelog = self._repo.file(self._repopath) | 421 self._filelog = self._repo.file(self._repopath) |
420 return self._filelog | 422 return self._filelog |
421 else: | 423 else: |
422 raise AttributeError, name | 424 raise AttributeError, name |
447 | 449 |
448 def parents(self): | 450 def parents(self): |
449 '''return parent filectxs, following copies if necessary''' | 451 '''return parent filectxs, following copies if necessary''' |
450 p = self._path | 452 p = self._path |
451 rp = self._repopath | 453 rp = self._repopath |
452 pcl = self._workingctx._parents | 454 pcl = self._changectx._parents |
453 fl = self._filelog | 455 fl = self._filelog |
454 pl = [ (rp, pcl[0]._manifest.get(rp, nullid), fl) ] | 456 pl = [ (rp, pcl[0]._manifest.get(rp, nullid), fl) ] |
455 if len(pcl) > 1: | 457 if len(pcl) > 1: |
456 if rp != p: | 458 if rp != p: |
457 fl = None | 459 fl = None |