hgext/extdiff.py
changeset 51855 b60f25f00e94
parent 51699 ca7bde5dbafb
child 51859 f4733654f144
--- a/hgext/extdiff.py	Wed Jun 19 18:06:50 2024 +0200
+++ b/hgext/extdiff.py	Thu Sep 12 12:28:27 2024 -0400
@@ -87,6 +87,12 @@
 import shutil
 import stat
 import subprocess
+import typing
+from typing import (
+    List,
+    Optional,
+    Tuple,
+)
 
 from mercurial.i18n import _
 from mercurial.node import (
@@ -111,6 +117,12 @@
     stringutil,
 )
 
+if typing.TYPE_CHECKING:
+    from mercurial import (
+        localrepo,
+        ui as uimod,
+    )
+
 cmdtable = {}
 command = registrar.command(cmdtable)
 
@@ -150,7 +162,14 @@
 testedwith = b'ships-with-hg-core'
 
 
-def snapshot(ui, repo, files, node, tmproot, listsubrepos):
+def snapshot(
+    ui: "uimod.ui",
+    repo: "localrepo.localrepository",
+    files,
+    node: Optional[bytes],
+    tmproot: bytes,
+    listsubrepos: bool,
+) -> Tuple[bytes, List[Tuple[bytes, bytes, os.stat_result]]]:
     """snapshot files as of some revision
     if not using snapshot, -I/-X does not work and recursive diff
     in tools like kdiff3 and meld displays too many files."""