Details
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers - Commits
- rHG680322e04f56: url: remove Python 2.7 support code
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
Alphare |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/url.py (11 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
0be1c59bcb54 | 1f171ca65d04 | Gregory Szorc | Feb 21 2022, 2:34 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | D12339 ui: use input() directly | |
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
# url.py - HTTP handling for mercurial | # url.py - HTTP handling for mercurial | ||||
# | # | ||||
# Copyright 2005, 2006, 2007, 2008 Olivia Mackall <olivia@selenic.com> | # Copyright 2005, 2006, 2007, 2008 Olivia Mackall <olivia@selenic.com> | ||||
# Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br> | # Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br> | ||||
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> | ||||
# | # | ||||
# This software may be used and distributed according to the terms of the | # This software may be used and distributed according to the terms of the | ||||
# GNU General Public License version 2 or any later version. | # GNU General Public License version 2 or any later version. | ||||
import base64 | import base64 | ||||
import socket | import socket | ||||
import sys | |||||
from .i18n import _ | from .i18n import _ | ||||
from .pycompat import getattr | from .pycompat import getattr | ||||
from . import ( | from . import ( | ||||
encoding, | encoding, | ||||
error, | error, | ||||
httpconnection as httpconnectionmod, | httpconnection as httpconnectionmod, | ||||
keepalive, | keepalive, | ||||
return keepalive.HTTPHandler._start_transaction(self, h, req) | return keepalive.HTTPHandler._start_transaction(self, h, req) | ||||
class logginghttpconnection(keepalive.HTTPConnection): | class logginghttpconnection(keepalive.HTTPConnection): | ||||
def __init__(self, createconn, *args, **kwargs): | def __init__(self, createconn, *args, **kwargs): | ||||
keepalive.HTTPConnection.__init__(self, *args, **kwargs) | keepalive.HTTPConnection.__init__(self, *args, **kwargs) | ||||
self._create_connection = createconn | self._create_connection = createconn | ||||
if sys.version_info < (2, 7, 7): | |||||
# copied from 2.7.14, since old implementations directly call | |||||
# socket.create_connection() | |||||
def connect(self): | |||||
self.sock = self._create_connection( | |||||
(self.host, self.port), self.timeout, self.source_address | |||||
) | |||||
if self._tunnel_host: | |||||
self._tunnel() | |||||
class logginghttphandler(httphandler): | class logginghttphandler(httphandler): | ||||
"""HTTP handler that logs socket I/O.""" | """HTTP handler that logs socket I/O.""" | ||||
def __init__(self, logfh, name, observeropts, timeout=None): | def __init__(self, logfh, name, observeropts, timeout=None): | ||||
super(logginghttphandler, self).__init__(timeout=timeout) | super(logginghttphandler, self).__init__(timeout=timeout) | ||||
self._logfh = logfh | self._logfh = logfh |