Patchwork template: rename successorssets template into successorgroup

login
register
mail settings
Submitter Boris Feld
Date July 7, 2017, 7:07 p.m.
Message ID <508801f7cd1304488b0d.1499454438@FB>
Download mbox | patch
Permalink /patch/22114/
State Accepted
Headers show

Comments

Boris Feld - July 7, 2017, 7:07 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499454363 -7200
#      Fri Jul 07 21:06:03 2017 +0200
# Node ID 508801f7cd1304488b0d9ebf02a76be030608b21
# Parent  e714159860fd0872ae0555bb07546aa7e9f700e0
# EXP-Topic renamesuccessosrssetstemplate
template: rename successorssets template into successorgroup

The new name seems better and easier to remember for users.
Sean Farley - July 7, 2017, 7:49 p.m.
Boris Feld <boris.feld@octobus.net> writes:

> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1499454363 -7200
> #      Fri Jul 07 21:06:03 2017 +0200
> # Node ID 508801f7cd1304488b0d9ebf02a76be030608b21
> # Parent  e714159860fd0872ae0555bb07546aa7e9f700e0
> # EXP-Topic renamesuccessosrssetstemplate
> template: rename successorssets template into successorgroup
>
> The new name seems better and easier to remember for users.

Looks good, queued!
Yuya Nishihara - July 8, 2017, 1:16 a.m.
On Fri, 07 Jul 2017 21:07:18 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1499454363 -7200
> #      Fri Jul 07 21:06:03 2017 +0200
> # Node ID 508801f7cd1304488b0d9ebf02a76be030608b21
> # Parent  e714159860fd0872ae0555bb07546aa7e9f700e0
> # EXP-Topic renamesuccessosrssetstemplate
> template: rename successorssets template into successorgroup
> 
> The new name seems better and easier to remember for users.
> 
> diff -r e714159860fd -r 508801f7cd13 mercurial/templatekw.py
> --- a/mercurial/templatekw.py	Fri Jul 07 08:33:10 2017 +0200
> +++ b/mercurial/templatekw.py	Fri Jul 07 21:06:03 2017 +0200
> @@ -602,8 +602,8 @@
>                     lambda x: {'ctx': repo[x], 'revcache': {}},
>                     lambda d: _formatrevnode(d['ctx']))
>  
> -@templatekeyword("successorssets")
> -def showsuccessorssets(repo, ctx, **args):
> +@templatekeyword("successorgroup")
> +def showsuccessorgroup(repo, ctx, **args):
>      """Returns a string of sets of successors for a changectx

Can we rename it to "successorgroups" (plural) as it's the convention of
templatekw? The inner list should be renamed to "successorgroup" or "group"
as well.
Sean Farley - July 10, 2017, 7:45 p.m.
Yuya Nishihara <yuya@tcha.org> writes:

> On Fri, 07 Jul 2017 21:07:18 +0200, Boris Feld wrote:
>> # HG changeset patch
>> # User Boris Feld <boris.feld@octobus.net>
>> # Date 1499454363 -7200
>> #      Fri Jul 07 21:06:03 2017 +0200
>> # Node ID 508801f7cd1304488b0d9ebf02a76be030608b21
>> # Parent  e714159860fd0872ae0555bb07546aa7e9f700e0
>> # EXP-Topic renamesuccessosrssetstemplate
>> template: rename successorssets template into successorgroup
>> 
>> The new name seems better and easier to remember for users.
>> 
>> diff -r e714159860fd -r 508801f7cd13 mercurial/templatekw.py
>> --- a/mercurial/templatekw.py	Fri Jul 07 08:33:10 2017 +0200
>> +++ b/mercurial/templatekw.py	Fri Jul 07 21:06:03 2017 +0200
>> @@ -602,8 +602,8 @@
>>                     lambda x: {'ctx': repo[x], 'revcache': {}},
>>                     lambda d: _formatrevnode(d['ctx']))
>>  
>> -@templatekeyword("successorssets")
>> -def showsuccessorssets(repo, ctx, **args):
>> +@templatekeyword("successorgroup")
>> +def showsuccessorgroup(repo, ctx, **args):
>>      """Returns a string of sets of successors for a changectx
>
> Can we rename it to "successorgroups" (plural) as it's the convention of
> templatekw? The inner list should be renamed to "successorgroup" or "group"
> as well.

Should I do this before pushing (forgot to push!)?
Yuya Nishihara - July 11, 2017, 12:26 p.m.
On Mon, 10 Jul 2017 12:45:12 -0700, Sean Farley wrote:
> Yuya Nishihara <yuya@tcha.org> writes:
> > On Fri, 07 Jul 2017 21:07:18 +0200, Boris Feld wrote:
> >> # HG changeset patch
> >> # User Boris Feld <boris.feld@octobus.net>
> >> # Date 1499454363 -7200
> >> #      Fri Jul 07 21:06:03 2017 +0200
> >> # Node ID 508801f7cd1304488b0d9ebf02a76be030608b21
> >> # Parent  e714159860fd0872ae0555bb07546aa7e9f700e0
> >> # EXP-Topic renamesuccessosrssetstemplate
> >> template: rename successorssets template into successorgroup
> >> 
> >> The new name seems better and easier to remember for users.
> >> 
> >> diff -r e714159860fd -r 508801f7cd13 mercurial/templatekw.py
> >> --- a/mercurial/templatekw.py	Fri Jul 07 08:33:10 2017 +0200
> >> +++ b/mercurial/templatekw.py	Fri Jul 07 21:06:03 2017 +0200
> >> @@ -602,8 +602,8 @@
> >>                     lambda x: {'ctx': repo[x], 'revcache': {}},
> >>                     lambda d: _formatrevnode(d['ctx']))
> >>  
> >> -@templatekeyword("successorssets")
> >> -def showsuccessorssets(repo, ctx, **args):
> >> +@templatekeyword("successorgroup")
> >> +def showsuccessorgroup(repo, ctx, **args):
> >>      """Returns a string of sets of successors for a changectx
> >
> > Can we rename it to "successorgroups" (plural) as it's the convention of
> > templatekw? The inner list should be renamed to "successorgroup" or "group"
> > as well.
> 
> Should I do this before pushing (forgot to push!)?

I prefer waiting V2 since this is just a single-line patch renaming the
function.
Sean Farley - July 11, 2017, 6:46 p.m.
Yuya Nishihara <yuya@tcha.org> writes:

> On Mon, 10 Jul 2017 12:45:12 -0700, Sean Farley wrote:
>> Yuya Nishihara <yuya@tcha.org> writes:
>> > On Fri, 07 Jul 2017 21:07:18 +0200, Boris Feld wrote:
>> >> # HG changeset patch
>> >> # User Boris Feld <boris.feld@octobus.net>
>> >> # Date 1499454363 -7200
>> >> #      Fri Jul 07 21:06:03 2017 +0200
>> >> # Node ID 508801f7cd1304488b0d9ebf02a76be030608b21
>> >> # Parent  e714159860fd0872ae0555bb07546aa7e9f700e0
>> >> # EXP-Topic renamesuccessosrssetstemplate
>> >> template: rename successorssets template into successorgroup
>> >> 
>> >> The new name seems better and easier to remember for users.
>> >> 
>> >> diff -r e714159860fd -r 508801f7cd13 mercurial/templatekw.py
>> >> --- a/mercurial/templatekw.py	Fri Jul 07 08:33:10 2017 +0200
>> >> +++ b/mercurial/templatekw.py	Fri Jul 07 21:06:03 2017 +0200
>> >> @@ -602,8 +602,8 @@
>> >>                     lambda x: {'ctx': repo[x], 'revcache': {}},
>> >>                     lambda d: _formatrevnode(d['ctx']))
>> >>  
>> >> -@templatekeyword("successorssets")
>> >> -def showsuccessorssets(repo, ctx, **args):
>> >> +@templatekeyword("successorgroup")
>> >> +def showsuccessorgroup(repo, ctx, **args):
>> >>      """Returns a string of sets of successors for a changectx
>> >
>> > Can we rename it to "successorgroups" (plural) as it's the convention of
>> > templatekw? The inner list should be renamed to "successorgroup" or "group"
>> > as well.
>> 
>> Should I do this before pushing (forgot to push!)?
>
> I prefer waiting V2 since this is just a single-line patch renaming the
> function.

Ok, I've dropped these from my queue.

Patch

diff -r e714159860fd -r 508801f7cd13 mercurial/templatekw.py
--- a/mercurial/templatekw.py	Fri Jul 07 08:33:10 2017 +0200
+++ b/mercurial/templatekw.py	Fri Jul 07 21:06:03 2017 +0200
@@ -602,8 +602,8 @@ 
                    lambda x: {'ctx': repo[x], 'revcache': {}},
                    lambda d: _formatrevnode(d['ctx']))
 
-@templatekeyword("successorssets")
-def showsuccessorssets(repo, ctx, **args):
+@templatekeyword("successorgroup")
+def showsuccessorgroup(repo, ctx, **args):
     """Returns a string of sets of successors for a changectx
 
     Format used is: [ctx1, ctx2], [ctx3] if ctx has been splitted into ctx1 and
diff -r e714159860fd -r 508801f7cd13 tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t	Fri Jul 07 08:33:10 2017 +0200
+++ b/tests/test-obsmarker-template.t	Fri Jul 07 21:06:03 2017 +0200
@@ -17,9 +17,9 @@ 
   >     {if(predecessors, "\n  semi-colon: {join(predecessors, "; ")}")}\
   >     {if(predecessors, "\n  json: {predecessors|json}")}\
   >     {if(predecessors, "\n  map: {join(predecessors % "{rev}:{node}", " ")}")}\
-  >     {if(successorssets, "\n  Successors: {successorssets}")}\
-  >     {if(successorssets, "\n  multi-line: {join(successorssets, "\n  multi-line: ")}")}\
-  >     {if(successorssets, "\n  json: {successorssets|json}")}\n'
+  >     {if(successorgroup, "\n  Successors: {successorgroup}")}\
+  >     {if(successorgroup, "\n  multi-line: {join(successorgroup, "\n  multi-line: ")}")}\
+  >     {if(successorgroup, "\n  json: {successorgroup|json}")}\n'
   > EOF
 
 Test templates on amended commit