diff mercurial/subrepo.py @ 51753:a1e4fa9330d8

typing: add type hints around the matcher for subrepo archiving Mostly this is meant to try to smoke out any other potential issues around the matcher, since these args were mostly previously treated as `Any`, and therefore checking wasn't done.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 01 Aug 2024 11:43:10 -0400
parents a53162bd73ed
children 3b8d92f71d92
line wrap: on
line diff
--- a/mercurial/subrepo.py	Thu Aug 01 01:52:11 2024 -0400
+++ b/mercurial/subrepo.py	Thu Aug 01 11:43:10 2024 -0400
@@ -363,7 +363,9 @@
         """handle the files command for this subrepo"""
         return 1
 
-    def archive(self, archiver, prefix, match, decode=True):
+    def archive(
+        self, archiver, prefix, match: matchmod.basematcher, decode=True
+    ):
         files = [f for f in self.files() if match(f)]
         total = len(files)
         relpath = subrelpath(self)
@@ -649,7 +651,9 @@
             )
 
     @annotatesubrepoerror
-    def archive(self, archiver, prefix, match, decode=True):
+    def archive(
+        self, archiver, prefix, match: matchmod.basematcher, decode=True
+    ):
         self._get(self._state + (b'hg',))
         files = [f for f in self.files() if match(f)]
         rev = self._state[1]
@@ -1906,7 +1910,9 @@
             else:
                 self.wvfs.unlink(f)
 
-    def archive(self, archiver, prefix, match, decode=True):
+    def archive(
+        self, archiver, prefix, match: matchmod.basematcher, decode=True
+    ):
         total = 0
         source, revision = self._state
         if not revision: