[PATCH 1 of 7 V3] revset: remove a rare usage of "%d" for a non-revision item

Yuya Nishihara yuya at tcha.org
Tue Jan 15 07:57:23 EST 2019


On Mon, 14 Jan 2019 15:27:17 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1547132233 -3600
> #      Thu Jan 10 15:57:13 2019 +0100
> # Node ID 15458ddc966d002a781d0be59cf2fa961790aa4c
> # Parent  c339a01acd9a5fda3ea9ed15b4342a0d08af5f96
> # EXP-Topic revs-efficiency
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 15458ddc966d
> revset: remove a rare usage of "%d" for a non-revision item

Queued the series, thanks.

> diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
> --- a/mercurial/wireprotov2server.py
> +++ b/mercurial/wireprotov2server.py
> @@ -823,8 +823,8 @@ def resolvenodes(repo, revisions):
>                          '%s key not present in changesetexplicitdepth revision '
>                          'specifier', (key,))
>  
> -            for rev in repo.revs(b'ancestors(%ln, %d)', spec[b'nodes'],
> -                                 spec[b'depth'] - 1):
> +            query = b'ancestors(%ln, %s)'
> +            for rev in repo.revs(query, spec[b'nodes'], spec[b'depth'] - 1):

I've inlined the query as before. Maybe you would prefer a temporary assignment
than multi-line expression, but there's no point to change the style in this
patch.


More information about the Mercurial-devel mailing list