[PATCH 2 of 2] revsetbenchmark: do not abort on failure to run a revset
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Sat Jun 20 22:38:43 CDT 2015
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1434842530 25200
# Sat Jun 20 16:22:10 2015 -0700
# Node ID da62bc192d63021803097a267d48e66f9f64e9fe
# Parent 75305531b0c92e31b35a3357774597ac78b1a1fd
revsetbenchmark: do not abort on failure to run a revset
Instead of aborting the whole process, we just skip entry for revset that
failed to run.
diff --git a/contrib/revsetbenchmarks.py b/contrib/revsetbenchmarks.py
--- a/contrib/revsetbenchmarks.py
+++ b/contrib/revsetbenchmarks.py
@@ -60,11 +60,11 @@ def perf(revset, target=None):
print >> sys.stderr, 'abort: cannot run revset benchmark: %s' % exc.cmd
if exc.output is None:
print >> sys.stderr, '(no ouput)'
else:
print >> sys.stderr, exc.output
- sys.exit(exc.returncode)
+ return None
outputre = re.compile(r'! wall (\d+.\d+) comb (\d+.\d+) user (\d+.\d+) '
'sys (\d+.\d+) \(best of (\d+)\)')
def parseoutput(output):
@@ -158,12 +158,17 @@ def formattiming(value):
_marker = object()
def printresult(variants, idx, data, maxidx, verbose=False, reference=_marker):
"""print a line of result to stdout"""
mask = '%%0%ii) %%s' % idxwidth(maxidx)
+
out = []
for var in variants:
+ if data[var] is None:
+ out.append('error ')
+ out.append(' ' * 4)
+ continue
out.append(formattiming(data[var]['wall']))
if reference is not _marker:
factor = None
if reference is not None:
factor = getfactor(reference[var], data[var], 'wall')
More information about the Mercurial-devel
mailing list