Mercurial > hg-stable
changeset 51964:3688a984134b
interfaces: change a couple of dirstate fields to `@property`
As I was adding type hints here and to the concrete classes, PyCharm flagged the
property in the core class as not being compatible with the base class's
version.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 27 Sep 2024 12:10:25 -0400 |
parents | e99c007030da |
children | 93d872a06132 |
files | mercurial/interfaces/dirstate.py |
diffstat | 1 files changed, 9 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/interfaces/dirstate.py Fri Sep 27 12:05:48 2024 -0400 +++ b/mercurial/interfaces/dirstate.py Fri Sep 27 12:10:25 2024 -0400 @@ -40,8 +40,9 @@ # public or removed from the interface. # TODO: decorate with `@rootcache(b'.hgignore')` like dirstate class? - _ignore: matchmod.basematcher - """Matcher for ignored files.""" + @property + def _ignore(self) -> matchmod.basematcher: + """Matcher for ignored files.""" @property def is_changing_any(self) -> bool: @@ -63,17 +64,15 @@ # TODO: decorate with `@util.propertycache` like dirstate class? # (can't because circular import) - # TODO: The doc looks wrong- the core class has this as a @property, not a - # callable. - _checklink: Callable - """Callable for checking symlinks.""" + @property + def _checklink(self) -> bool: + """Callable for checking symlinks.""" # TODO: this comment looks stale # TODO: decorate with `@util.propertycache` like dirstate class? # (can't because circular import) - # TODO: The doc looks wrong- the core class has this as a @property, not a - # callable. - _checkexec: Callable - """Callable for checking exec bits.""" + @property + def _checkexec(self) -> bool: + """Callable for checking exec bits.""" # TODO: this comment looks stale @contextlib.contextmanager def changing_parents(self, repo):