diff hgext/git/dirstate.py @ 51921:3a90a6fd710d

dirstate: subclass the new dirstate Protocol class Behold the chaos that ensues. We'll use the generated *.pyi files to apply type annotations to the interface, and see how much agrees with the documentation. Since the CamelCase name was used to try to work around pytype issues with zope interfaces and is a new innovation this cycle (see c1d7ac70980b), drop the CamelCase name. I think the Protocol classes *should* be CamelCase, but that can be done later in one pass. For now, the CamelCase alias is extra noise in the *.pyi files.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 26 Sep 2024 18:52:46 -0400
parents 51be8bf8c986
children e99c007030da
line wrap: on
line diff
--- a/hgext/git/dirstate.py	Thu Sep 26 18:51:03 2024 -0400
+++ b/hgext/git/dirstate.py	Thu Sep 26 18:52:46 2024 -0400
@@ -18,7 +18,6 @@
 )
 from mercurial.interfaces import (
     dirstate as intdirstate,
-    util as interfaceutil,
 )
 
 from . import gitutil
@@ -73,8 +72,7 @@
     }
 
 
-@interfaceutil.implementer(intdirstate.idirstate)
-class gitdirstate:
+class gitdirstate(intdirstate.idirstate):
     def __init__(self, ui, vfs, gitrepo, use_dirstate_v2):
         self._ui = ui
         self._root = os.path.dirname(vfs.base)