Mercurial > public > mercurial-scm > hg
comparison mercurial/verify.py @ 51714:45828bc3c3d6
typing: add type hints to `mercurial.verify._normpath()`
Since 10db46e128d4, pytype almost figured this out, going from `Any` -> `_T0`,
but the intent is obvious.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 18 Jul 2024 20:34:35 -0400 |
parents | 812cd3dfa4cb |
children | 73b9558a0c56 |
comparison
equal
deleted
inserted
replaced
51713:f841de63a5aa | 51714:45828bc3c3d6 |
---|---|
29 with repo.lock(): | 29 with repo.lock(): |
30 v = verifier(repo, level) | 30 v = verifier(repo, level) |
31 return v.verify() | 31 return v.verify() |
32 | 32 |
33 | 33 |
34 def _normpath(f): | 34 def _normpath(f: bytes) -> bytes: |
35 # under hg < 2.4, convert didn't sanitize paths properly, so a | 35 # under hg < 2.4, convert didn't sanitize paths properly, so a |
36 # converted repo may contain repeated slashes | 36 # converted repo may contain repeated slashes |
37 while b'//' in f: | 37 while b'//' in f: |
38 f = f.replace(b'//', b'/') | 38 f = f.replace(b'//', b'/') |
39 return f | 39 return f |