mercurial/scmposix.py
changeset 49808 7a4143428db7
parent 49804 a87338fe8cfa
child 50929 18c8c18993f0
--- a/mercurial/scmposix.py	Thu Dec 15 01:05:27 2022 -0500
+++ b/mercurial/scmposix.py	Thu Dec 15 15:41:59 2022 -0500
@@ -4,6 +4,11 @@
 import os
 import sys
 
+from typing import (
+    List,
+    Tuple,
+)
+
 from .pycompat import getattr
 from . import (
     encoding,
@@ -11,6 +16,9 @@
     util,
 )
 
+if pycompat.TYPE_CHECKING:
+    from . import ui as uimod
+
 # BSD 'more' escapes ANSI color sequences by default. This can be disabled by
 # $MORE variable, but there's no compatible option with Linux 'more'. Given
 # OS X is widely used and most modern Unix systems would have 'less', setting
@@ -18,7 +26,7 @@
 fallbackpager = b'less'
 
 
-def _rcfiles(path):
+def _rcfiles(path: bytes) -> List[bytes]:
     rcs = [os.path.join(path, b'hgrc')]
     rcdir = os.path.join(path, b'hgrc.d')
     try:
@@ -34,7 +42,7 @@
     return rcs
 
 
-def systemrcpath():
+def systemrcpath() -> List[bytes]:
     path = []
     if pycompat.sysplatform == b'plan9':
         root = b'lib/mercurial'
@@ -49,7 +57,7 @@
     return path
 
 
-def userrcpath():
+def userrcpath() -> List[bytes]:
     if pycompat.sysplatform == b'plan9':
         return [encoding.environ[b'home'] + b'/lib/hgrc']
     elif pycompat.isdarwin:
@@ -65,7 +73,7 @@
         ]
 
 
-def termsize(ui):
+def termsize(ui: "uimod.ui") -> Tuple[int, int]:
     try:
         import termios