[PATCH 04 of 14] git: add stubs for gittreemanifestctx methods

Josef 'Jeff' Sipek jeffpc at josefsipek.net
Thu Jan 2 18:58:26 UTC 2025


 hgext/git/manifest.py |  20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)


# HG changeset patch
# User Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
# Date 1735835265 18000
#      Thu Jan 02 11:27:45 2025 -0500
# Node ID 9e1a23c56c561d136d273cecb35f515fbd57adcd
# Parent  202e225c76b580b23c3c472ac2e1a47ae1ab260d
git: add stubs for gittreemanifestctx methods

$ hg log
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.11.10 (main, Oct 31 2024, 01:10:40) [Clang 18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15
** Mercurial Distributed SCM (version 6.9.post1.dev337+hg.72af9fa34832)
** Extensions loaded: absorb, churn, git (pygit2 1.14.1), githelp, gpg, hgk, histedit, patchbomb, rebase
Traceback (most recent call last):
  File "/home/jeffpc/src/oss/hg-gitext-test/../hg-gitext/hg", line 61, in <module>
    dispatch.run()
...
  File "/usr/home/jeffpc/src/oss/hg-gitext/hgext/git/gitlog.py", line 564, in get
    return gitmanifest.gittreemanifestctx(self.gitrepo, t)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Can't instantiate abstract class gittreemanifestctx with abstract methods node, read_any_fast_delta, read_delta_new_entries, read_delta_parents, readdelta

diff --git a/hgext/git/manifest.py b/hgext/git/manifest.py
--- a/hgext/git/manifest.py
+++ b/hgext/git/manifest.py
@@ -309,6 +309,26 @@ class gittreemanifestctx(repository.iman
     def find(self, path: bytes) -> tuple[bytes, bytes]:
         return self.read().find(path)
 
+    def node(self) -> bytes:
+        raise error.Abort(b"not yet implemented")
+
+    def readdelta(self, shallow: bool = False):
+        raise error.Abort(b"not yet implemented")
+
+    def read_any_fast_delta(
+        self,
+        valid_bases: Collection[int] | None = None,
+        *,
+        shallow: bool = False,
+    ):
+        raise error.Abort(b"not yet implemented")
+
+    def read_delta_parents(self, *, shallow: bool = False, exact: bool = True):
+        raise error.Abort(b"not yet implemented")
+
+    def read_delta_new_entries(self, *, shallow: bool = False):
+        raise error.Abort(b"not yet implemented")
+
 
 class memgittreemanifestctx(repository.imanifestrevisionwritable):
     def __init__(self, repo, tree):



More information about the Mercurial-devel mailing list