changeset 14287:7c231754a621

filelog: add file function to open other filelogs
author Sune Foldager <cryo@cyanite.org>
date Tue, 10 May 2011 17:38:58 +0200
parents 005a540e9aee
children 00a0ab08f986
files mercurial/bundlerepo.py mercurial/filelog.py
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Tue May 10 14:42:53 2011 +0200
+++ b/mercurial/bundlerepo.py	Tue May 10 17:38:58 2011 +0200
@@ -150,10 +150,14 @@
                               linkmapper)
 
 class bundlefilelog(bundlerevlog, filelog.filelog):
-    def __init__(self, opener, path, bundle, linkmapper):
+    def __init__(self, opener, path, bundle, linkmapper, repo):
         filelog.filelog.__init__(self, opener, path)
         bundlerevlog.__init__(self, opener, self.indexfile, bundle,
                               linkmapper)
+        self._repo = repo
+
+    def _file(self, f):
+        self._repo.file(f)
 
 class bundlerepository(localrepo.localrepository):
     def __init__(self, ui, path, bundlename):
@@ -244,7 +248,7 @@
         if f in self.bundlefilespos:
             self.bundle.seek(self.bundlefilespos[f])
             return bundlefilelog(self.sopener, f, self.bundle,
-                                 self.changelog.rev)
+                                 self.changelog.rev, self)
         else:
             return filelog.filelog(self.sopener, f)
 
--- a/mercurial/filelog.py	Tue May 10 14:42:53 2011 +0200
+++ b/mercurial/filelog.py	Tue May 10 17:38:58 2011 +0200
@@ -87,3 +87,6 @@
             return t2 != text
 
         return True
+
+    def _file(self, f):
+        return filelog(self.opener, f)