( )⚙ D2725 httppeer: refactor how httppeer is created (API)

This is an archive of the discontinued Mercurial Phabricator instance.

httppeer: refactor how httppeer is created (API)
ClosedPublic

Authored by indygreg on Mar 8 2018, 12:31 AM.

Details

Summary

Previously, we passed a bunch of arguments to httppeer.init,
validated them, then possibly constructed a valid instance.

A short while ago, we refactored sshpeer so all the validation and
setup work occurs before the constructor. We introduced a makepeer()
to hold most of this logic.

This commit gives httppeer the same treatment.

As a sign that the previous design was poor, del no longer
conditionally checks for the presence of an attribute that may
not be defined (it is always defined in the new code).

.. api::

httppeer.httppeer.__init__ now takes additional arguments.
Instances should be obtained by calling httppeer.instance()
or httppeer.makepeer() instead.

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.