# HG changeset patch # User Sune Foldager # Date 2011-05-10 15:38:58 # Node ID 7c231754a621d84f4b50fb62db22c9409f4b391c # Parent 005a540e9aeeb4eb54b244f9f17410818d177127 filelog: add file function to open other filelogs diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -150,10 +150,14 @@ class bundlemanifest(bundlerevlog, manif 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 @@ class bundlerepository(localrepo.localre 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) diff --git a/mercurial/filelog.py b/mercurial/filelog.py --- a/mercurial/filelog.py +++ b/mercurial/filelog.py @@ -87,3 +87,6 @@ class filelog(revlog.revlog): return t2 != text return True + + def _file(self, f): + return filelog(self.opener, f)