Patchwork D2723: httppeer: consolidate _requestbuilder assignments and document

login
register
mail settings
Submitter phabricator
Date March 15, 2018, 6:20 p.m.
Message ID <bdfce1856f5ce2b0b7ab3088d08d43eb@localhost.localdomain>
Download mbox | patch
Permalink /patch/29548/
State Not Applicable
Headers show

Comments

phabricator - March 15, 2018, 6:20 p.m.
indygreg updated this revision to Diff 7070.
indygreg edited the summary of this revision.
indygreg retitled this revision from "httppeer: remove _requestbuilder attribute" to "httppeer: consolidate _requestbuilder assignments and document".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2723?vs=6973&id=7070

REVISION DETAIL
  https://phab.mercurial-scm.org/D2723

AFFECTED FILES
  mercurial/httppeer.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: martinvonz, pulkit, mercurial-devel

Patch

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -138,7 +138,9 @@ 
         self._path = path
         self._caps = None
         self._urlopener = None
-        self._requestbuilder = None
+        # This is an its own attribute to facilitate extensions overriding
+        # the default type.
+        self._requestbuilder = urlreq.request
         u = util.url(path)
         if u.query or u.fragment:
             raise error.Abort(_('unsupported URL component: "%s"') %
@@ -151,7 +153,6 @@ 
         ui.debug('using %s\n' % self._url)
 
         self._urlopener = urlmod.opener(ui, authinfo)
-        self._requestbuilder = urlreq.request
 
     def __del__(self):
         urlopener = getattr(self, '_urlopener', None)