##// END OF EJS Templates
context: make filectx remember changectx in changectx.filectx
Matt Mackall -
r3214:696c6562 default
parent child Browse files
Show More
@@ -83,7 +83,7 b' class changectx(object):'
83 83 """get a file context from this changeset"""
84 84 if fileid is None:
85 85 fileid = self.filenode(path)
86 return filectx(self._repo, path, fileid=fileid)
86 return filectx(self._repo, path, fileid=fileid, changectx=self)
87 87
88 88 def filectxs(self):
89 89 """generate a file context for each file in this changeset's
@@ -104,7 +104,8 b' class changectx(object):'
104 104 class filectx(object):
105 105 """A filecontext object makes access to data related to a particular
106 106 filerevision convenient."""
107 def __init__(self, repo, path, changeid=None, fileid=None, filelog=None):
107 def __init__(self, repo, path, changeid=None, fileid=None,
108 filelog=None, changectx=None):
108 109 """changeid can be a changeset revision, node, or tag.
109 110 fileid can be a file revision or node."""
110 111 self._repo = repo
@@ -114,6 +115,9 b' class filectx(object):'
114 115
115 116 if filelog:
116 117 self._filelog = filelog
118 if changectx:
119 self._changectx = changectx
120 self._changeid = changectx.node()
117 121
118 122 if fileid is None:
119 123 self._changeid = changeid
General Comments 0
You need to be logged in to leave comments. Login now