Patchwork [7,of,7] templatekw: remove unneeded showtags

login
register
mail settings
Submitter Sean Farley
Date Dec. 17, 2014, 12:02 a.m.
Message ID <afc6a00471fda3a8f3f1.1418774521@laptop.local>
Download mbox | patch
Permalink /patch/7134/
State Superseded
Commit d69a7fc68ad54de9ae4956d6efc2ebd4afc220f3
Headers show

Comments

Sean Farley - Dec. 17, 2014, 12:02 a.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1418665202 28800
#      Mon Dec 15 09:40:02 2014 -0800
# Node ID afc6a00471fda3a8f3f17824b5ff4d2beb723924
# Parent  957096b720f355369f56ceebd088a11b7ed37ebc
templatekw: remove unneeded showtags

Now that we have the machinery of namespaces in-place, we use that instead of
hand-rolling our own template function.
Ryan McElroy - Dec. 17, 2014, 1:38 a.m.
This series looks good to me after addressing the translation stuff mentioned in the first patch.

> -----Original Message-----

> From: Mercurial-devel [mailto:mercurial-devel-bounces@selenic.com] On

> Behalf Of Sean Farley

> Sent: Tuesday, December 16, 2014 4:02 PM

> To: mercurial-devel@selenic.com

> Subject: [PATCH 7 of 7] templatekw: remove unneeded showtags

> 

> # HG changeset patch

> # User Sean Farley <sean.michael.farley@gmail.com>

> # Date 1418665202 28800

> #      Mon Dec 15 09:40:02 2014 -0800

> # Node ID afc6a00471fda3a8f3f17824b5ff4d2beb723924

> # Parent  957096b720f355369f56ceebd088a11b7ed37ebc

> templatekw: remove unneeded showtags

> 

> Now that we have the machinery of namespaces in-place, we use that

> instead of

> hand-rolling our own template function.

> 

> diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py

> --- a/mercurial/templatekw.py

> +++ b/mercurial/templatekw.py

> @@ -372,14 +372,10 @@ def showsubrepos(**args):

>      for sub in psubstate:

>          if sub not in substate:

>              subrepos.append(sub) # removed in ctx

>      return showlist('subrepo', sorted(subrepos), **args)

> 

> -def showtags(**args):

> -    """:tags: List of strings. Any tags associated with the changeset."""

> -    return showlist('tag', args['ctx'].tags(), **args)

> -

>  def shownames(namespace, **args):

>      """helper method to generate a template keyword for a namespace"""

>      ctx = args['ctx']

>      repo = ctx._repo

>      names = repo.names.names(repo, namespace, ctx.node())

> @@ -422,11 +418,10 @@ keywords = {

>      'p2node': showp2node,

>      'phase': showphase,

>      'phaseidx': showphaseidx,

>      'rev': showrev,

>      'subrepos': showsubrepos,

> -    'tags': showtags,

>  }

> 

>  def _showparents(**args):

>      """:parents: List of strings. The parents of the changeset in "rev:node"

>      format. If the changeset has only one "natural" parent (the predecessor

> _______________________________________________

> Mercurial-devel mailing list

> Mercurial-devel@selenic.com

> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -372,14 +372,10 @@  def showsubrepos(**args):
     for sub in psubstate:
         if sub not in substate:
             subrepos.append(sub) # removed in ctx
     return showlist('subrepo', sorted(subrepos), **args)
 
-def showtags(**args):
-    """:tags: List of strings. Any tags associated with the changeset."""
-    return showlist('tag', args['ctx'].tags(), **args)
-
 def shownames(namespace, **args):
     """helper method to generate a template keyword for a namespace"""
     ctx = args['ctx']
     repo = ctx._repo
     names = repo.names.names(repo, namespace, ctx.node())
@@ -422,11 +418,10 @@  keywords = {
     'p2node': showp2node,
     'phase': showphase,
     'phaseidx': showphaseidx,
     'rev': showrev,
     'subrepos': showsubrepos,
-    'tags': showtags,
 }
 
 def _showparents(**args):
     """:parents: List of strings. The parents of the changeset in "rev:node"
     format. If the changeset has only one "natural" parent (the predecessor