diff --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -9,6 +9,11 @@ import errno import os +from typing import ( + List, + Tuple, +) + from .i18n import _ from . import ( encoding, @@ -107,7 +112,7 @@ class config: def sections(self): return sorted(self._data.keys()) - def items(self, section): + def items(self, section: bytes) -> List[Tuple[bytes, bytes]]: items = self._data.get(section, {}).items() return [(k, v[0]) for (k, v) in items] diff --git a/mercurial/subrepoutil.py b/mercurial/subrepoutil.py --- a/mercurial/subrepoutil.py +++ b/mercurial/subrepoutil.py @@ -74,7 +74,7 @@ def state(ctx: "context.changectx", ui: to tuple: (source from .hgsub, revision from .hgsubstate, kind (key in types dict)) """ - p = config.config() + p: config.config = config.config() repo = ctx.repo() def read(f, sections=None, remap=None): @@ -143,7 +143,7 @@ def state(ctx: "context.changectx", ui: return src state = {} - for path, src in p.items(b''): # type: bytes + for path, src in p.items(b''): kind = b'hg' if src.startswith(b'['): if b']' not in src: