--- a/mercurial/interfaces/modules.py Sat Sep 28 19:12:18 2024 -0400
+++ b/mercurial/interfaces/modules.py Sun Sep 29 02:03:20 2024 -0400
@@ -8,14 +8,19 @@
import typing
from typing import (
+ Callable,
List,
+ Optional,
Protocol,
Tuple,
)
if typing.TYPE_CHECKING:
BDiffBlock = Tuple[int, int, int, int]
- """An entry in the list returned by bdiff.blocks()."""
+ """An entry in the list returned by bdiff.{xdiff,}blocks()."""
+
+ BDiffBlocksFnc = Callable[[bytes, bytes], List[BDiffBlock]]
+ """The signature of `bdiff.blocks()` and `bdiff.xdiffblocks()`."""
class BDiff(Protocol):
@@ -32,3 +37,6 @@
def fixws(self, text: bytes, allws: bool) -> bytes:
...
+
+ xdiffblocks: Optional[BDiffBlocksFnc]
+ """This method is currently only available in the ``cext`` module."""