[PATCH 1 of 2 V2] perf: introduce a perfrevlogwrite command

Yuya Nishihara yuya at tcha.org
Thu Oct 25 07:24:00 EDT 2018


On Fri, 19 Oct 2018 14:25:13 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1538556809 -7200
> #      Wed Oct 03 10:53:29 2018 +0200
> # Node ID 78ffc55c0d6034972ea3d49b8c565c563ef27121
> # Parent  824b687ff6af49622a18dfea760cf41a7abe5aa7
> # EXP-Topic revlog-perf
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 78ffc55c0d60
> perf: introduce a perfrevlogwrite command

Looks generally good.

> + at command(b'perfrevlogwrite', revlogopts + formatteropts +
> +         [(b's', b'startrev', 1000, b'revision to start writing at'),
> +          (b'', b'stoprev', -1, b'last revision to write'),
> +          (b'', b'count', 3, b'last revision to write'),
> +         ],
> +         b'-c|-m|FILE')
> +def perfrevlogwrite(ui, repo, file_=None, startrev=0, stoprev=-1, **opts):

Which is the default startrev value? 1000 or 0?

> +def _timeonewrite(ui, orig, startrev, stoprev, runidx=None):
> +    timings = []
> +    tr = type('faketr', (object,) , {'add': lambda s, x, y, z=None:None})()

Nit: I prefer using 'class faketr' syntax.


More information about the Mercurial-devel mailing list