Patchwork [6,of,9,RFC] templatekw: add a function to help generate a keyword for a marker

login
register
mail settings
Submitter Sean Farley
Date March 30, 2014, 11:09 p.m.
Message ID <bd0a4d48b4ec44de53ec.1396220944@laptop.local>
Download mbox | patch
Permalink /patch/4153/
State Deferred
Headers show

Comments

Sean Farley - March 30, 2014, 11:09 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1396218756 18000
#      Sun Mar 30 17:32:36 2014 -0500
# Node ID bd0a4d48b4ec44de53ec8710f077ddf1850900a4
# Parent  edf2cf8e1b4ba5796c8cec04956b0e080c089862
templatekw: add a function to help generate a keyword for a marker

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -347,10 +347,18 @@  def showrev(repo, ctx, templ, **args):
 
 def showtags(**args):
     """:tags: List of strings. Any tags associated with the changeset."""
     return showlist('tag', args['ctx'].tags(), **args)
 
+def showmarkers(namespace, **args):
+    """:tags: List of strings. Any markers in the namespace `namespace` associated
+    with the changeset.
+    """
+    return showlist(namespace,
+                    args['repo'].nodemarkers(args['ctx'].node(), namespace),
+                    **args)
+
 # keywords are callables like:
 # fn(repo, ctx, templ, cache, revcache, **args)
 # with:
 # repo - current repository instance
 # ctx - the changectx being displayed