# HG changeset patch # User Gregory Szorc # Date 2018-02-13 01:14:29 # Node ID 874209855f5c15ba6df624a53568eb5def09f48f # Parent a463f375f02188bc7ec4358af147e672eb035aa0 httppeer: remove httpspeer All it did was verify at construction time that Mercurial supports TLS. instance() is what's used to construct peer instances. So we can just inline this check into that function and do away with the type variant. Differential Revision: https://phab.mercurial-scm.org/D2216 diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -480,22 +480,15 @@ class httppeer(wireproto.wirepeer): def _abort(self, exception): raise exception -class httpspeer(httppeer): - def __init__(self, ui, path): - if not url.has_https: - raise error.Abort(_('Python support for SSL and HTTPS ' - 'is not installed')) - httppeer.__init__(self, ui, path) - def instance(ui, path, create): if create: raise error.Abort(_('cannot create new http repository')) try: - if path.startswith('https:'): - inst = httpspeer(ui, path) - else: - inst = httppeer(ui, path) + if path.startswith('https:') and not url.has_https: + raise error.Abort(_('Python support for SSL and HTTPS ' + 'is not installed')) + inst = httppeer(ui, path) inst._fetchcaps() return inst