Patchwork [FOLLOW,UP] nodesummaries: improve format pattern used

login
register
mail settings
Submitter Boris Feld
Date Dec. 4, 2017, 10:43 a.m.
Message ID <c442effb81084ab881b8.1512384238@FB>
Download mbox | patch
Permalink /patch/25916/
State Accepted
Headers show

Comments

Boris Feld - Dec. 4, 2017, 10:43 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1512376777 -3600
#      Mon Dec 04 09:39:37 2017 +0100
# Node ID c442effb81084ab881b807033a671b6cb5396b40
# Parent  aef2b98d935292bc5abf1d91751f7675e3176ffa
# EXP-Topic small-fixup
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c442effb8108
nodesummaries: improve format pattern used

As spotted by Yuya Nishihara, that value is an integer.
Pulkit Goyal - Dec. 4, 2017, 10:50 a.m.
Thanks for the followup, looks good to me.

On Mon, Dec 4, 2017 at 4:13 PM, Boris Feld <boris.feld@octobus.net> wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1512376777 -3600
> #      Mon Dec 04 09:39:37 2017 +0100
> # Node ID c442effb81084ab881b807033a671b6cb5396b40
> # Parent  aef2b98d935292bc5abf1d91751f7675e3176ffa
> # EXP-Topic small-fixup
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c442effb8108
> nodesummaries: improve format pattern used
>
> As spotted by Yuya Nishihara, that value is an integer.
>
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -1284,7 +1284,7 @@ def nodesummaries(repo, nodes, maxnumnod
>      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)
> +    return _("%s and %d others") % (first, len(nodes) - maxnumnodes)
>
>  def enforcesinglehead(repo, tr, desc):
>      """check that no named branch has multiple heads"""
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Yuya Nishihara - Dec. 4, 2017, 1:48 p.m.
On Mon, 04 Dec 2017 11:43:58 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1512376777 -3600
> #      Mon Dec 04 09:39:37 2017 +0100
> # Node ID c442effb81084ab881b807033a671b6cb5396b40
> # Parent  aef2b98d935292bc5abf1d91751f7675e3176ffa
> # EXP-Topic small-fixup
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c442effb8108
> nodesummaries: improve format pattern used

Queued, thanks.

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1284,7 +1284,7 @@  def nodesummaries(repo, nodes, maxnumnod
     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)
+    return _("%s and %d others") % (first, len(nodes) - maxnumnodes)
 
 def enforcesinglehead(repo, tr, desc):
     """check that no named branch has multiple heads"""