context: create a filectxt with filelog reuse
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Mon, 25 Dec 2006 18:57:55 +0100
changeset 3966 b4eaa68dea1b
parent 3965 2e5161335e65
child 3967 dccb83241dd0
context: create a filectxt with filelog reuse
mercurial/context.py
--- a/mercurial/context.py	Mon Dec 25 17:43:47 2006 +0100
+++ b/mercurial/context.py	Mon Dec 25 18:57:55 2006 +0100
@@ -93,11 +93,12 @@
 
         return node
 
-    def filectx(self, path, fileid=None):
+    def filectx(self, path, fileid=None, filelog=None):
         """get a file context from this changeset"""
         if fileid is None:
             fileid = self.filenode(path)
-        return filectx(self._repo, path, fileid=fileid, changectx=self)
+        return filectx(self._repo, path, fileid=fileid,
+                       changectx=self, filelog=filelog)
 
     def filectxs(self):
         """generate a file context for each file in this changeset's
@@ -422,9 +423,10 @@
     def children(self):
         return []
 
-    def filectx(self, path):
+    def filectx(self, path, filelog=None):
         """get a file context from the working directory"""
-        return workingfilectx(self._repo, path, workingctx=self)
+        return workingfilectx(self._repo, path, workingctx=self,
+                              filelog=filelog)
 
     def ancestor(self, c2):
         """return the ancestor context of self and c2"""