##// END OF EJS Templates
py3: make test-contrib-perf.t work on python 3...
Pulkit Goyal -
r40569:b456b2e0 default
parent child Browse files
Show More
@@ -75,6 +75,7 b' try:'
75 75 _byteskwargs = pycompat.byteskwargs # since 4.1 (or fbc3f73dc802)
76 76 _sysstr = pycompat.sysstr # since 4.0 (or 2219f4f82ede)
77 77 _xrange = pycompat.xrange # since 4.8 (or 7eba8f83129b)
78 fsencode = pycompat.fsencode # since 3.9 (or f4a5e0e86a7e)
78 79 if pycompat.ispy3:
79 80 _maxint = sys.maxsize # per py3 docs for replacing maxint
80 81 else:
@@ -83,6 +84,7 b' except (ImportError, AttributeError):'
83 84 import inspect
84 85 getargspec = inspect.getargspec
85 86 _byteskwargs = identity
87 fsencode = identity # no py3 support
86 88 _maxint = sys.maxint # no py3 support
87 89 _sysstr = lambda x: x # no py3 support
88 90 _xrange = xrange
@@ -968,7 +970,7 b' def perfindex(ui, repo, **opts):'
968 970 def perfstartup(ui, repo, **opts):
969 971 opts = _byteskwargs(opts)
970 972 timer, fm = gettimer(ui, opts)
971 cmd = sys.argv[0]
973 cmd = fsencode(sys.argv[0])
972 974 def d():
973 975 if os.name != r'nt':
974 976 os.system(b"HGRCPATH= %s version -q > /dev/null" % cmd)
@@ -1387,17 +1389,18 b' def perfdiffwd(ui, repo, **opts):'
1387 1389 opts = _byteskwargs(opts)
1388 1390 timer, fm = gettimer(ui, opts)
1389 1391 options = {
1390 b'w': b'ignore_all_space',
1391 b'b': b'ignore_space_change',
1392 b'B': b'ignore_blank_lines',
1392 'w': 'ignore_all_space',
1393 'b': 'ignore_space_change',
1394 'B': 'ignore_blank_lines',
1393 1395 }
1394 1396
1395 for diffopt in (b'', b'w', b'b', b'B', b'wB'):
1397 for diffopt in ('', 'w', 'b', 'B', 'wB'):
1396 1398 opts = dict((options[c], b'1') for c in diffopt)
1397 1399 def d():
1398 1400 ui.pushbuffer()
1399 1401 commands.diff(ui, repo, **opts)
1400 1402 ui.popbuffer()
1403 diffopt = diffopt.encode('ascii')
1401 1404 title = b'diffopts: %s' % (diffopt and (b'-' + diffopt) or b'none')
1402 1405 timer(d, title)
1403 1406 fm.end()
@@ -1773,7 +1776,7 b' def perfrevlogrevision(ui, repo, file_, '
1773 1776 data = segmentforrevs(chain[0], chain[-1])[1]
1774 1777 rawchunks = getrawchunks(data, chain)
1775 1778 bins = r._chunks(chain)
1776 text = str(bins[0])
1779 text = bytes(bins[0])
1777 1780 bins = bins[1:]
1778 1781 text = mdiff.patches(text, bins)
1779 1782
@@ -85,6 +85,7 b' test-context.py'
85 85 test-contrib-check-code.t
86 86 test-contrib-check-commit.t
87 87 test-contrib-dumprevlog.t
88 test-contrib-perf.t
88 89 test-contrib-testparseutil.t
89 90 test-convert-authormap.t
90 91 test-convert-clonebranches.t
General Comments 0
You need to be logged in to leave comments. Login now