diff --git a/mercurial/interfaces/status.py b/mercurial/interfaces/status.py --- a/mercurial/interfaces/status.py +++ b/mercurial/interfaces/status.py @@ -7,6 +7,8 @@ from __future__ import annotations +import abc + from typing import ( Iterator, Protocol, @@ -42,8 +44,10 @@ class Status(Protocol): clean: list[bytes] """The list of files that are not in any other state.""" + @abc.abstractmethod def __iter__(self) -> Iterator[list[bytes]]: """Iterates over each of the categories of file lists.""" + @abc.abstractmethod def __repr__(self) -> str: """Creates a string representation of the file lists.""" diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -64,6 +64,8 @@ from . import ( vfs, ) +from .interfaces import status as istatus + from .utils import ( hashutil, procutil, @@ -87,7 +89,7 @@ termsize = scmplatform.termsize @attr.s(slots=True, repr=False) -class status: +class status(istatus.Status): """Struct with a list of files per status. The 'deleted', 'unknown' and 'ignored' properties are only