changeset 794:c32c92fdca5b

util: use real function definitions for keywords, document them Starting with mercurial 1.9 template keywords and filters documentation is generated from the items docstrings.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 12 Mar 2011 15:27:22 +0100
parents e698be84c22d
children 6f0b0a47938c
files hgsubversion/util.py
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -203,10 +203,22 @@ def _templatehelper(ctx, kw):
     else:
         raise hgutil.Abort('unrecognized hgsubversion keyword %s' % kw)
 
+def svnrevkw(**args):
+    """:svnrev: String. Converted subversion revision number."""
+    return _templatehelper(args['ctx'], 'svnrev')
+
+def svnpathkw(**args):
+    """:svnpath: String. Converted subversion revision project path."""
+    return _templatehelper(args['ctx'], 'svnpath')
+
+def svnuuidkw(**args):
+    """:svnuuid: String. Converted subversion revision repository identifier."""
+    return _templatehelper(args['ctx'], 'svnuuid')
+
 templatekeywords = {
-    'svnrev': (lambda repo, ctx, templ, **a: _templatehelper(ctx, 'svnrev')),
-    'svnpath': (lambda repo, ctx, templ, **a: _templatehelper(ctx, 'svnpath')),
-    'svnuuid': (lambda repo, ctx, templ, **a: _templatehelper(ctx, 'svnuuid')),
+    'svnrev': svnrevkw,
+    'svnpath': svnpathkw,
+    'svnuuid': svnuuidkw,
 }
 
 def revset_fromsvn(repo, subset, x):