changeset 13592:ad2ee188f4a5

templates: document missing keywords or filters Keywords keywords are not documented yet but are turned into function definitions to avoid lambda docstring weirdness.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 12 Mar 2011 12:46:31 +0100
parents 264f292a0c6f
children cc4721ed7a2a
files hgext/keyword.py mercurial/templatekw.py
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Sat Mar 12 12:46:31 2011 +0100
+++ b/hgext/keyword.py	Sat Mar 12 12:46:31 2011 +0100
@@ -109,11 +109,14 @@
 }
 
 # date like in cvs' $Date
-utcdate = lambda x: util.datestr((x[0], 0), '%Y/%m/%d %H:%M:%S')
+def utcdate(text):
+    return util.datestr((text[0], 0), '%Y/%m/%d %H:%M:%S')
 # date like in svn's $Date
-svnisodate = lambda x: util.datestr(x, '%Y-%m-%d %H:%M:%S %1%2 (%a, %d %b %Y)')
+def svnisodate(text):
+    return util.datestr(text, '%Y-%m-%d %H:%M:%S %1%2 (%a, %d %b %Y)')
 # date like in svn's $Id
-svnutcdate = lambda x: util.datestr((x[0], 0), '%Y-%m-%d %H:%M:%SZ')
+def svnutcdate(text):
+    return util.datestr((text[0], 0), '%Y-%m-%d %H:%M:%SZ')
 
 # make keyword tools accessible
 kwtools = {'templater': None, 'hgcmd': ''}
--- a/mercurial/templatekw.py	Sat Mar 12 12:46:31 2011 +0100
+++ b/mercurial/templatekw.py	Sat Mar 12 12:46:31 2011 +0100
@@ -163,6 +163,9 @@
         return showlist('branch', [branch], plural='branches', **args)
 
 def showbookmarks(**args):
+    """:bookmarks: List of strings. Any bookmarks associated with the
+    changeset.
+    """
     bookmarks = args['ctx'].bookmarks()
     return showlist('bookmark', bookmarks, **args)