comparison hgext/git/manifest.py @ 52619:b9f47b685e90

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
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Thu, 02 Jan 2025 11:27:45 -0500
parents 6412dcec52d3
children 2b65c9228dc0
comparison
equal deleted inserted replaced
52618:143063a94085 52619:b9f47b685e90
2 2
3 import typing 3 import typing
4 4
5 from typing import ( 5 from typing import (
6 Any, 6 Any,
7 Collection,
7 Iterable, 8 Iterable,
8 Iterator, 9 Iterator,
9 Set, 10 Set,
10 ) 11 )
11 12
306 # because the caller expects a mutable manifest. 307 # because the caller expects a mutable manifest.
307 return memgittreemanifestctx(self._repo, self._tree) 308 return memgittreemanifestctx(self._repo, self._tree)
308 309
309 def find(self, path: bytes) -> tuple[bytes, bytes]: 310 def find(self, path: bytes) -> tuple[bytes, bytes]:
310 return self.read().find(path) 311 return self.read().find(path)
312
313 def node(self) -> bytes:
314 raise NotImplementedError
315
316 def readdelta(self, shallow: bool = False):
317 raise NotImplementedError
318
319 def read_any_fast_delta(
320 self,
321 valid_bases: Collection[int] | None = None,
322 *,
323 shallow: bool = False,
324 ):
325 raise NotImplementedError
326
327 def read_delta_parents(self, *, shallow: bool = False, exact: bool = True):
328 raise NotImplementedError
329
330 def read_delta_new_entries(self, *, shallow: bool = False):
331 raise NotImplementedError
311 332
312 333
313 class memgittreemanifestctx(repository.imanifestrevisionwritable): 334 class memgittreemanifestctx(repository.imanifestrevisionwritable):
314 def __init__(self, repo, tree): 335 def __init__(self, repo, tree):
315 self._repo = repo 336 self._repo = repo