[PATCH 2 of 2] revsetbenchmark: do not abort on failure to run a revset

Augie Fackler raf at durin42.com
Mon Jun 22 09:23:22 CDT 2015


On Sat, Jun 20, 2015 at 08:38:43PM -0700, Pierre-Yves David wrote:
> # 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.

I'm not super-thrilled with this. Could we be capturing the error
output somehow?

>
> 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')
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list