diff mercurial/pathutil.py @ 52906:bde94bd8e8a2

typing: use a protocol to annotate `pathutil.dirs` in repository.py That is one external import for the repository interface module. One more to go.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 08 Feb 2025 18:15:18 +0100
parents 0bd91b0a1a93
children
line wrap: on
line diff
--- a/mercurial/pathutil.py	Sat Feb 08 18:12:29 2025 +0100
+++ b/mercurial/pathutil.py	Sat Feb 08 18:15:18 2025 +0100
@@ -22,6 +22,8 @@
     util,
 )
 
+from .interfaces import misc as int_misc
+
 rustdirs = policy.importrust('dirstate', 'Dirs', pyo3=True)
 parsers = policy.importmod('parsers')
 
@@ -335,7 +337,7 @@
         pos = path.find(pycompat.ossep, pos + 1)
 
 
-class dirs:
+class dirs(int_misc.IDirs):
     '''a multiset of directory names from a set of file paths'''
 
     def __init__(self, map, only_tracked=False):