manifest: drop the `indexfile` from `manifestrevlog`
Since `manifestrevlog` object 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.
Differential Revision: https://phab.mercurial-scm.org/D10572
--- a/mercurial/bundlerepo.py Mon May 03 12:21:46 2021 +0200
+++ b/mercurial/bundlerepo.py Mon May 03 12:21:56 2021 +0200
@@ -201,7 +201,7 @@
self,
opener,
(revlog_constants.KIND_MANIFESTLOG, dir),
- self.indexfile,
+ self._revlog.indexfile,
cgunpacker,
linkmapper,
)
--- a/mercurial/changegroup.py Mon May 03 12:21:46 2021 +0200
+++ b/mercurial/changegroup.py Mon May 03 12:21:56 2021 +0200
@@ -803,9 +803,15 @@
return i
# We failed to resolve a parent for this node, so
# we crash the changegroup construction.
+ if util.safehasattr(store, 'target'):
+ target = store.indexfile
+ else:
+ # some revlog not actually a revlog
+ target = store._revlog.indexfile
+
raise error.Abort(
b"unable to resolve parent while packing '%s' %r"
- b' for changeset %r' % (store.indexfile, rev, clrev)
+ b' for changeset %r' % (target, rev, clrev)
)
return nullrev
--- a/mercurial/interfaces/repository.py Mon May 03 12:21:46 2021 +0200
+++ b/mercurial/interfaces/repository.py Mon May 03 12:21:56 2021 +0200
@@ -1167,13 +1167,6 @@
"""An ``ifilerevisionssequence`` instance."""
)
- indexfile = interfaceutil.Attribute(
- """Path of revlog index file.
-
- TODO this is revlog specific and should not be exposed.
- """
- )
-
opener = interfaceutil.Attribute(
"""VFS opener to use to access underlying files used for storage.
--- a/mercurial/manifest.py Mon May 03 12:21:46 2021 +0200
+++ b/mercurial/manifest.py Mon May 03 12:21:56 2021 +0200
@@ -1907,14 +1907,6 @@
)
@property
- def indexfile(self):
- return self._revlog.indexfile
-
- @indexfile.setter
- def indexfile(self, value):
- self._revlog.indexfile = value
-
- @property
def opener(self):
return self._revlog.opener
--- a/mercurial/unionrepo.py Mon May 03 12:21:46 2021 +0200
+++ b/mercurial/unionrepo.py Mon May 03 12:21:56 2021 +0200
@@ -174,7 +174,7 @@
manifest.manifestrevlog.__init__(self, nodeconstants, opener)
manifest2 = manifest.manifestrevlog(nodeconstants, opener2)
unionrevlog.__init__(
- self, opener, self.indexfile, manifest2, linkmapper
+ self, opener, self._revlog.indexfile, manifest2, linkmapper
)