This is an archive of the discontinued Mercurial Phabricator instance.

sshpeer: make instance attributes and methods internal
ClosedPublic

Authored by indygreg on Aug 11 2017, 12:20 AM.

Details

Summary

Peer types are supposed to conform to a formal interface defined by
peer.peerrepository and wireproto.wirepeer. Every "public" attribute on
*peer types makes it harder to understand what attributes are part
of the interface and what are instance specific.

This commit converts a number of "public" instance attributes and
methods on sshpeer to internal so they can't be confused to be part of
the peer API.

The URL-related instance attributes were introduced in 876333a295ff
in 2005. AFAICT most of them aren't used and could potentially be
removed. But I kept them around anyway.

I also reorded some code to make things slightly easier to read.

.. api::

Rename attributes on sshpeer to reflect peer API

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Aug 11 2017, 12:20 AM

Silly question, what is the deprecation policy for such internal classes?

The deprecation policy isn't super well defined. Essentially, every change we ask ourselves how common we think out-of-repo consumers are. "Internal" attributes we typically don't even warn about changing them. For something like @command, we make noise and set a long deprecation policy (a few releases to a year).

durin42 accepted this revision.Aug 11 2017, 2:24 PM
durin42 added a subscriber: durin42.

I've queued up to this point in the series.

This revision is now accepted and ready to land.Aug 11 2017, 2:24 PM
This revision was automatically updated to reflect the committed changes.