Mercurial > hg
changeset 51715:7601978f9e9f
typing: add type hints to `cmdutil.findrepo()`
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 19:55:51 -0400 |
parents | 45d5e9a0f6a6 |
children | f3b34386d3e0 |
files | mercurial/cmdutil.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu Jul 18 19:01:55 2024 -0400 +++ b/mercurial/cmdutil.py Thu Jul 18 19:55:51 2024 -0400 @@ -1112,7 +1112,7 @@ ui.status(_(b"changed branch on %d changesets\n") % len(replacements)) -def findrepo(p): +def findrepo(p: bytes) -> Optional[bytes]: while not os.path.isdir(os.path.join(p, b".hg")): oldp, p = p, os.path.dirname(p) if p == oldp: