Mercurial > hg
comparison mercurial/httppeer.py @ 36959:43815d87c6aa
httppeer: alias url as urlmod
"url" is a common variable name. We do this aliasing elsewhere to
avoid shadowing.
Differential Revision: https://phab.mercurial-scm.org/D2724
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 07 Mar 2018 19:57:50 -0800 |
parents | 5bc7ff103081 |
children | 586891c561dc |
comparison
equal
deleted
inserted
replaced
36958:644a02f6b34f | 36959:43815d87c6aa |
---|---|
20 bundle2, | 20 bundle2, |
21 error, | 21 error, |
22 httpconnection, | 22 httpconnection, |
23 pycompat, | 23 pycompat, |
24 statichttprepo, | 24 statichttprepo, |
25 url, | 25 url as urlmod, |
26 util, | 26 util, |
27 wireproto, | 27 wireproto, |
28 ) | 28 ) |
29 | 29 |
30 httplib = util.httplib | 30 httplib = util.httplib |
148 self._url, authinfo = u.authinfo() | 148 self._url, authinfo = u.authinfo() |
149 | 149 |
150 self._ui = ui | 150 self._ui = ui |
151 ui.debug('using %s\n' % self._url) | 151 ui.debug('using %s\n' % self._url) |
152 | 152 |
153 self._urlopener = url.opener(ui, authinfo) | 153 self._urlopener = urlmod.opener(ui, authinfo) |
154 self._requestbuilder = urlreq.request | 154 self._requestbuilder = urlreq.request |
155 | 155 |
156 def __del__(self): | 156 def __del__(self): |
157 urlopener = getattr(self, '_urlopener', None) | 157 urlopener = getattr(self, '_urlopener', None) |
158 if urlopener: | 158 if urlopener: |
484 | 484 |
485 def instance(ui, path, create): | 485 def instance(ui, path, create): |
486 if create: | 486 if create: |
487 raise error.Abort(_('cannot create new http repository')) | 487 raise error.Abort(_('cannot create new http repository')) |
488 try: | 488 try: |
489 if path.startswith('https:') and not url.has_https: | 489 if path.startswith('https:') and not urlmod.has_https: |
490 raise error.Abort(_('Python support for SSL and HTTPS ' | 490 raise error.Abort(_('Python support for SSL and HTTPS ' |
491 'is not installed')) | 491 'is not installed')) |
492 | 492 |
493 inst = httppeer(ui, path) | 493 inst = httppeer(ui, path) |
494 inst._fetchcaps() | 494 inst._fetchcaps() |