Mercurial > public > mercurial-scm > hg-stable
changeset 52495:1df97507c6b8
interfaces: convert `repository.peer` to a Protocol class
This is similar to the transformation in 3a90a6fd710d for dirstate. However,
`ipeerbase` isn't referenced anywhere other than the `implementer` decorator on
this class. I suspect, based on the lack of `self` args on these classes prior
to c1674551c109, that zope enforced that interfaces and implementations are
separate entities. `Protocol` does not, so fold the former interface definition
into the class.
Per (seemingly undocumented) pytype desire, the `Protocol` subclass comes last
in the list.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 22 Oct 2024 17:02:21 -0400 |
parents | 4cc186255672 |
children | f968926a4207 |
files | mercurial/interfaces/repository.py |
diffstat | 1 files changed, 2 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/interfaces/repository.py Tue Oct 22 16:56:53 2024 -0400 +++ b/mercurial/interfaces/repository.py Tue Oct 22 17:02:21 2024 -0400 @@ -399,18 +399,13 @@ """ -class ipeerbase(_ipeerconnection, ipeercapabilities, ipeerrequests): +class peer(_ipeerconnection, ipeercapabilities, ipeerrequests, Protocol): """Unified interface for peer repositories. All peer instances must conform to this interface. """ - -@interfaceutil.implementer(ipeerbase) -class peer: - """Base class for peer repositories.""" - - limitedarguments = False + limitedarguments: bool = False def __init__(self, ui, path=None, remotehidden=False): self.ui = ui