comparison mercurial/context.py @ 3133:02b22fefc01f

changectx: add ancestor function
author Matt Mackall <mpm@selenic.com>
date Sun, 17 Sep 2006 22:59:33 -0500
parents 4d021b91cb26
children 4bf2e895cf86
comparison
equal deleted inserted replaced
3132:4d021b91cb26 3133:02b22fefc01f
64 mf = self.manifest() 64 mf = self.manifest()
65 m = mf.keys() 65 m = mf.keys()
66 m.sort() 66 m.sort()
67 for f in m: 67 for f in m:
68 yield self.filectx(f, fileid=mf[f]) 68 yield self.filectx(f, fileid=mf[f])
69
70 def ancestor(self, c2):
71 """
72 return the ancestor context of self and c2
73 """
74 n = self._repo.changelog.ancestor(self._node, c2._node)
75 return changectx(self._repo, n)
69 76
70 class filectx(object): 77 class filectx(object):
71 """A filecontext object makes access to data related to a particular 78 """A filecontext object makes access to data related to a particular
72 filerevision convenient.""" 79 filerevision convenient."""
73 def __init__(self, repo, path, changeid=None, fileid=None, filelog=None): 80 def __init__(self, repo, path, changeid=None, fileid=None, filelog=None):