changeset 52495:6412dcec52d3

manifest: subclass the new `repository.imanifestdict` Protocol class This is the same transformation as 3a90a6fd710d did for dirstate, but the CamelCase naming was already cleaned up here. See 4ef6dbc27a99 for the benefits of explicit subclassing.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 23 Oct 2024 15:58:32 -0400
parents db6efd74cf14
children e123c8a26a70
files hgext/git/manifest.py mercurial/manifest.py
diffstat 2 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/git/manifest.py	Wed Dec 11 02:02:34 2024 -0500
+++ b/hgext/git/manifest.py	Wed Oct 23 15:58:32 2024 -0400
@@ -17,7 +17,6 @@
 )
 from mercurial.interfaces import (
     repository,
-    util as interfaceutil,
 )
 from . import gitutil
 
@@ -29,8 +28,7 @@
 pygit2 = gitutil.get_pygit2()
 
 
-@interfaceutil.implementer(repository.imanifestdict)
-class gittreemanifest:
+class gittreemanifest(repository.imanifestdict):
     """Expose git trees (and optionally a builder's overlay) as a manifestdict.
 
     Very similar to mercurial.manifest.treemanifest.
--- a/mercurial/manifest.py	Wed Dec 11 02:02:34 2024 -0500
+++ b/mercurial/manifest.py	Wed Oct 23 15:58:32 2024 -0400
@@ -508,7 +508,7 @@
     _lazymanifest = _LazyManifest
 
 
-class manifestdict:  # (repository.imanifestdict)
+class manifestdict(repository.imanifestdict):
     def __init__(self, nodelen: int, data: ByteString = b''):
         self._nodelen = nodelen
         self._lm = _lazymanifest(nodelen, data)