Patchwork D10573: filelog: drop `indexfile` from `filelog`

login
register
mail settings
Submitter phabricator
Date May 3, 2021, 11:56 a.m.
Message ID <differential-rev-PHID-DREV-tygpsmo3jek6k2bezh44-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48889/
State New
Headers show

Comments

phabricator - May 3, 2021, 11:56 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Since `filelog` objects are not revlog (no really, they are not…) we drop the
  revlog specific attribute. We need to directly access the underlying revlog in a
  couple of place that already assume that we have a revlog here.
  
  This is motivated by future change to that revlog attribute.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10573

AFFECTED FILES
  mercurial/bundlerepo.py
  mercurial/filelog.py
  mercurial/unionrepo.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py
--- a/mercurial/unionrepo.py
+++ b/mercurial/unionrepo.py
@@ -183,7 +183,7 @@ 
         filelog.filelog.__init__(self, opener, path)
         filelog2 = filelog.filelog(opener2, path)
         self._revlog = unionrevlog(
-            opener, self.indexfile, filelog2._revlog, linkmapper
+            opener, self._revlog.indexfile, filelog2._revlog, linkmapper
         )
         self._repo = repo
         self.repotiprev = self._revlog.repotiprev
diff --git a/mercurial/filelog.py b/mercurial/filelog.py
--- a/mercurial/filelog.py
+++ b/mercurial/filelog.py
@@ -228,18 +228,6 @@ 
             storedsize=storedsize,
         )
 
-    # TODO these aren't part of the interface and aren't internal methods.
-    # Callers should be fixed to not use them.
-
-    # Used by bundlefilelog, unionfilelog.
-    @property
-    def indexfile(self):
-        return self._revlog.indexfile
-
-    @indexfile.setter
-    def indexfile(self, value):
-        self._revlog.indexfile = value
-
     # Used by repo upgrade.
     def clone(self, tr, destrevlog, **kwargs):
         if not isinstance(destrevlog, filelog):
diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -233,7 +233,7 @@ 
             opener,
             # XXX should use the unencoded path
             target=(revlog_constants.KIND_FILELOG, path),
-            indexfile=self.indexfile,
+            indexfile=self._revlog.indexfile,
             cgunpacker=cgunpacker,
             linkmapper=linkmapper,
         )