[PATCH 1 of 2 V2] scmutil: extra utility to display a reasonable amount of nodes

Yuya Nishihara yuya at tcha.org
Sat Dec 2 13:45:00 UTC 2017


On Mon, 20 Nov 2017 18:15:21 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1510800758 -3600
> #      Thu Nov 16 03:52:38 2017 +0100
> # Node ID 5312b5738172718b868c1ecfd28ada8d4d7e85de
> # Parent  69ea10d5b00c499f14f9b8f285a09163a592ef3e
> # EXP-Topic single-heads
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 5312b5738172
> scmutil: extra utility to display a reasonable amount of nodes

> +def nodesummaries(repo, nodes, maxnumnodes=4):
> +    if len(nodes) <= maxnumnodes or repo.ui.verbose:
> +        return ' '.join(short(h) for h in nodes)
> +    first = ' '.join(short(h) for h in nodes[:maxnumnodes])
> +    return _("%s and %s others") % (first, len(nodes) - maxnumnodes)

Nit: '%s and %d others'
             ^^

Please send a follow up.


More information about the Mercurial-devel mailing list