mercurial/interfaces/dirstate.py
changeset 51917 382d9629cede
parent 51859 f4733654f144
child 51918 13aa17512583
--- a/mercurial/interfaces/dirstate.py	Thu Sep 26 17:47:39 2024 -0400
+++ b/mercurial/interfaces/dirstate.py	Thu Sep 26 18:04:31 2024 -0400
@@ -2,26 +2,32 @@
 
 import contextlib
 
+from typing import (
+    Protocol,
+)
+
 from . import util as interfaceutil
 
 
-class idirstate(interfaceutil.Interface):
-    def __init__(
-        opener,
-        ui,
-        root,
-        validate,
-        sparsematchfn,
-        nodeconstants,
-        use_dirstate_v2,
-        use_tracked_hint=False,
-    ):
-        """Create a new dirstate object.
-
-        opener is an open()-like callable that can be used to open the
-        dirstate file; root is the root of the directory tracked by
-        the dirstate.
-        """
+class idirstate(Protocol):
+    # TODO: convert these constructor args to fields?
+    # def __init__(
+    #     self,
+    #     opener,
+    #     ui,
+    #     root,
+    #     validate,
+    #     sparsematchfn,
+    #     nodeconstants,
+    #     use_dirstate_v2,
+    #     use_tracked_hint=False,
+    # ):
+    #     """Create a new dirstate object.
+    #
+    #     opener is an open()-like callable that can be used to open the
+    #     dirstate file; root is the root of the directory tracked by
+    #     the dirstate.
+    #     """
 
     # TODO: all these private methods and attributes should be made
     # public or removed from the interface.