##// END OF EJS Templates
url: always use str for proxy configuration...
url: always use str for proxy configuration Previously, proxies didn't work on Python 3 for various reasons. First, the keys to the "proxies" dict are fed into a `setattr(self, "%s_open", ...)` call and passing bytestrings results in setting an oddly named attribute due to the b'' in %s formatting. This resulted in "http_open" and "https_open" not being properly overridden and proxies not being used. Second, the standard library was expecting proxy URLs to be str. And various operations (including our custom code in url.py) would fail to account for the str/bytes mismatch. This commit normalizes everything to str and adjusts our proxy code in url.py to account for the presence of str on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5952

File last commit:

r36061:3b4d14be default
r41859:4028897d default
Show More
ext-phase-report.py
22 lines | 799 B | text/x-python | PythonLexer
/ tests / testlib / ext-phase-report.py
Boris Feld
phases: test phases tracking at the transaction level...
r33459 # tiny extension to report phase changes during transaction
from __future__ import absolute_import
def reposetup(ui, repo):
def reportphasemove(tr):
Gregory Szorc
py3: port ext-phase-report.py extension...
r36061 for rev, move in sorted(tr.changes[b'phases'].items()):
Boris Feld
phases: test phases tracking at the transaction level...
r33459 if move[0] is None:
Gregory Szorc
py3: port ext-phase-report.py extension...
r36061 ui.write((b'test-debug-phase: new rev %d: x -> %d\n'
Boris Feld
phases: test phases tracking at the transaction level...
r33459 % (rev, move[1])))
else:
Gregory Szorc
py3: port ext-phase-report.py extension...
r36061 ui.write((b'test-debug-phase: move rev %d: %d -> %d\n'
Boris Feld
phases: test phases tracking at the transaction level...
r33459 % (rev, move[0], move[1])))
class reportphaserepo(repo.__class__):
def transaction(self, *args, **kwargs):
tr = super(reportphaserepo, self).transaction(*args, **kwargs)
Gregory Szorc
py3: port ext-phase-report.py extension...
r36061 tr.addpostclose(b'report-phase', reportphasemove)
Boris Feld
phases: test phases tracking at the transaction level...
r33459 return tr
repo.__class__ = reportphaserepo