diff -r 483b0bb23085 -r bde94bd8e8a2 mercurial/interfaces/misc.py --- a/mercurial/interfaces/misc.py Sat Feb 08 18:12:29 2025 +0100 +++ b/mercurial/interfaces/misc.py Sat Feb 08 18:15:18 2025 +0100 @@ -7,6 +7,7 @@ from typing import ( Callable, + Iterator, List, Protocol, ) @@ -24,3 +25,23 @@ @abc.abstractmethod def __call__(self, *args) -> List: ... + + +class IDirs(Protocol): + '''a multiset of directory names from a set of file paths''' + + @abc.abstractmethod + def addpath(self, path: bytes) -> None: + ... + + @abc.abstractmethod + def delpath(self, path: bytes) -> None: + ... + + @abc.abstractmethod + def __iter__(self) -> Iterator[bytes]: + ... + + @abc.abstractmethod + def __contains__(self, d: bytes) -> bool: + ...