mercurial/cext/parsers.pyi
author Matt Harbison <matt_harbison@yahoo.com>
Mon, 07 Dec 2020 16:18:28 -0500
changeset 46071 cc0b332ab9fc
parent 46042 8dca9051a859
child 47083 12450fbea288
permissions -rw-r--r--
run-tests: stuff a `python3.exe` into the test bin directory on Windows Windows doesn't have `python3.exe` as part of the python.org distribution, and that broke every script with a shebang after c102b704edb5. Windows itself provides a `python3.exe` app execution alias[1], but it is some sort of reparse point that MSYS is incapable of handling[2]. When run by MSYS, it simply prints $ python3 -V - Cannot open That in turn caused every `hghave` check, and test that invokes shebang scripts directly, to fail. Rather than try to patch up every script call to be invoked with `$PYTHON` (and regress when non Windows developers forget), copying the executable into the test binary directory with the new name just works. Since this directory is prepended to the system PATH value, it also overrides the broken execution alias. (The `_tmpbindir` is used instead of `_bindir` because the latter causes python3.exe to be copied into the repo next to hg.exe when `test-run-tests.t` runs. Something runs with this version of the executable and subsequent runs of `run-tests.py` inside `test-run-tests.t` try to copy over it while it is in use, and fail. This avoids the failures and the clutter.) I didn't conditionalize this on py3 because `python3.exe` needs to be present (for the shebangs) even when running py2 tests. It shouldn't matter to these simple scripts, and I think the intention is to make the test runner use py3 always, even if testing a py2 build. For now, still supporting py2 is helping to clean up the mess that is py3 tests. [1] https://stackoverflow.com/a/57168165 [2] https://stackoverflow.com/questions/59148628/solved-unable-to-run-python-3-7-on-windows-10-permission-denied#comment104524397_59148666 Differential Revision: https://phab.mercurial-scm.org/D9543
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46042
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
from typing import (
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
    Callable,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
    Dict,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
    Iterator,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
    List,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
    Optional,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
    Set,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
    Tuple,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
    Union,
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
)
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
version: int
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
versionerrortext: str
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
class dirstatetuple:
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
    __doc__: str
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
    def __len__(self) -> int: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
    def __getitem__(self, key: int) -> Union[bytes, int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
# From dirs.c
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
class dirs:
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
    __doc__: str
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
    def __init__(self, source, skipchar: bytes): ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
    def __iter__(self) -> Iterator[bytes]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
    def addpath(self, path: bytes) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
    def delpath(self, path: bytes) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
# From manifest.c
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
class lazymanifest:
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
    def __init__(self, data: bytes): ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
    def __iter__(self) -> Iterator[bytes]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
    def __len__(self) -> int: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
    def __getitem__(self, item: bytes) -> Optional[Tuple[bytes, bytes]]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
    def __setitem__(self, key: bytes, value: Tuple[bytes, bytes]) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
    def __delitem__(self, key: bytes) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
    def iterkeys(self) -> Iterator[bytes]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
    def iterentries(self) -> Iterator[Tuple[bytes, bytes, bytes]]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
    def copy(self) -> lazymanifest: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
    def filtercopy(self, matchfn: Callable[[bytes], bool]) -> lazymanifest: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
    def diff(self, other: lazymanifest, clean: Optional[bool]) -> Dict[bytes, Tuple[bytes, Tuple]]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
    def text(self) -> bytes: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    46
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
# From revlog.c
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
class index:
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
    __doc__: str
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
    nodemap: Dict[bytes, int]
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
    def ancestors(self, *args: int) -> Iterator[int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
    def commonancestorsheads(self, *args: int) -> List[int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
    def clearcaches(self) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
    def get(self, value: bytes) -> Optional[int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
    def get_rev(self, value: bytes) -> Optional[int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
    def has_node(self, value: Union[int, bytes]) -> bool: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
    def rev(self, node: bytes) -> int: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
    def computephasesmapsets(self, root: Dict[int, Set[bytes]]) -> Tuple[int, Dict[int, Set[bytes]]]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
    def reachableroots2(self, minroot: int, heads: List[int], roots: List[int], includepath: bool) -> List[int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
    def headrevs(self, filteredrevs: Optional[List[int]]) -> List[int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
    def headrevsfiltered(self, filteredrevs: Optional[List[int]]) -> List[int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
    def issnapshot(self, value: int) -> bool: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
    def findsnapshots(self, cache: Dict[int, List[int]], start_rev: int) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
    def deltachain(self, rev: int, stop: int, generaldelta: bool) -> Tuple[List[int], bool]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
    def slicechunktodensity(self, revs: List[int], targetdensity: float, mingapsize: int) -> List[List[int]]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
    def append(self, value: Tuple[int, int, int, int, int, int, int, bytes]) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
    def partialmatch(self, node: bytes) -> bytes: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
    def shortest(self, value: bytes) -> int: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
    def stats(self) -> Dict[bytes, int]: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
class nodetree:
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
    __doc__: str
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
    def insert(self, rev: int) -> None: ...
8dca9051a859 cext: add .pyi files for C extensions
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
    def shortest(self, node: bytes) -> int: ...