Patchwork D2723: httppeer: remove _requestbuilder attribute

login
register
mail settings
Submitter phabricator
Date March 8, 2018, 5:31 a.m.
Message ID <differential-rev-PHID-DREV-ol5o7u24vmms7g5u4xts-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29116/
State Superseded
Headers show

Comments

phabricator - March 8, 2018, 5:31 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This was a glorified alias to a function in another module. I have no
  clue why it existed.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/httppeer.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - March 15, 2018, 4:18 p.m.
pulkit added a comment.


  Looks like this was added so that extensions can replace using urllib2.Request. https://www.mercurial-scm.org/repo/hg/rev/00ecc894138d

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - March 15, 2018, 4:26 p.m.
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D2723#46187, @pulkit wrote:
  
  > Looks like this was added so that extensions can replace using urllib2.Request. https://www.mercurial-scm.org/repo/hg/rev/00ecc894138d
  
  
  Thanks for looking that up. We still depend on it, so we'd appreciate if it could stay. Perhaps we should have added comment saying that it was there for extensibility.

REPOSITORY
  rHG Mercurial

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

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,6 @@ 
         self._path = path
         self._caps = None
         self._urlopener = None
-        self._requestbuilder = None
         u = util.url(path)
         if u.query or u.fragment:
             raise error.Abort(_('unsupported URL component: "%s"') %
@@ -151,7 +150,6 @@ 
         ui.debug('using %s\n' % self._url)
 
         self._urlopener = url.opener(ui, authinfo)
-        self._requestbuilder = urlreq.request
 
     def __del__(self):
         urlopener = getattr(self, '_urlopener', None)
@@ -328,7 +326,7 @@ 
         if varyheaders:
             headers[r'Vary'] = r','.join(varyheaders)
 
-        req = self._requestbuilder(pycompat.strurl(cu), data, headers)
+        req = urlreq.request(pycompat.strurl(cu), data, headers)
 
         if data is not None:
             self.ui.debug("sending %d bytes\n" % size)