# HG changeset patch # User Matt Mackall # Date 1159819348 18000 # Node ID 696c656202a0a75d289ac4f63c31d37c5499ca6d # Parent e8199702cf4ed16c58bc7ff414d6e39847fc64b1 context: make filectx remember changectx in changectx.filectx diff -r e8199702cf4e -r 696c656202a0 mercurial/context.py --- a/mercurial/context.py Mon Oct 02 14:23:38 2006 -0500 +++ b/mercurial/context.py Mon Oct 02 15:02:28 2006 -0500 @@ -83,7 +83,7 @@ """get a file context from this changeset""" if fileid is None: fileid = self.filenode(path) - return filectx(self._repo, path, fileid=fileid) + return filectx(self._repo, path, fileid=fileid, changectx=self) def filectxs(self): """generate a file context for each file in this changeset's @@ -104,7 +104,8 @@ class filectx(object): """A filecontext object makes access to data related to a particular filerevision convenient.""" - def __init__(self, repo, path, changeid=None, fileid=None, filelog=None): + def __init__(self, repo, path, changeid=None, fileid=None, + filelog=None, changectx=None): """changeid can be a changeset revision, node, or tag. fileid can be a file revision or node.""" self._repo = repo @@ -114,6 +115,9 @@ if filelog: self._filelog = filelog + if changectx: + self._changectx = changectx + self._changeid = changectx.node() if fileid is None: self._changeid = changeid