[PATCH 7 of 8] revset: detect integer list on parsing

Yuya Nishihara yuya at tcha.org
Fri Jan 11 23:38:06 EST 2019


On Fri, 11 Jan 2019 12:29:09 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1546575973 -3600
> #      Fri Jan 04 05:26:13 2019 +0100
> # Node ID 4a56fbdacff33c3985bbb84f2e19ddfbd48ed4fa
> # Parent  438ea9b8a44c181d62741338c1d16b2031fdda41
> # EXP-Topic revs-efficiency
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 4a56fbdacff3
> revset: detect integer list on parsing

> +            if islist and d == 'd' and arg:
> +                # special case, we might be able to speedup the list of int case
> +                safeinputtype = (list, tuple, set, smartset.abstractsmartset)
> +                if isinstance(arg, safeinputtype):

Just curious. What's the unsafe type for example? I think 'arg' may be an
iterator/generator of ints, but which can be safely converted to list/baseset.

> +                    # we don't create a baseset yet, because it come with an
> +                    # extra cost. If we are going to serialize it we better
> +                    # skip it.
> +                    ret.append(('baseset', arg))
> +                    pos += 1
> +                    continue


More information about the Mercurial-devel mailing list