filectx: fix annotate to not directly instantiate filectx
authorDurham Goode <durham@fb.com>
Fri, 09 Jan 2015 11:21:29 -0800
changeset 23770 50f0096a7346
parent 23769 bb3ee61cfaa1
child 23771 9f81f9e5b47a
filectx: fix annotate to not directly instantiate filectx 28a302e9225d changed basefilectx.annotate() to directly instantiate new filectx's instead of going through self.filectx(), this breaks extensions that replace the filectx class, and would also break future uses that would need memfilectx's.
mercurial/context.py
--- a/mercurial/context.py	Wed Dec 31 18:39:41 2014 -0500
+++ b/mercurial/context.py	Fri Jan 09 11:21:29 2015 -0800
@@ -893,8 +893,7 @@
         base = self
         introrev = self.introrev()
         if self.rev() != introrev:
-            base = filectx(self._repo, self._path, filelog=self.filelog(),
-                           fileid=self.filenode(), changeid=introrev)
+            base = self.filectx(self.filenode(), changeid=introrev)
 
         # This algorithm would prefer to be recursive, but Python is a
         # bit recursion-hostile. Instead we do an iterative
@@ -1000,11 +999,11 @@
             # considered when solving linkrev issue are on the table.
             return changectx(self._repo.unfiltered(), self._changeid)
 
-    def filectx(self, fileid):
+    def filectx(self, fileid, changeid=None):
         '''opens an arbitrary revision of the file without
         opening a new filelog'''
         return filectx(self._repo, self._path, fileid=fileid,
-                       filelog=self._filelog)
+                       filelog=self._filelog, changeid=changeid)
 
     def data(self):
         try: