# HG changeset patch # User Patrick Mezard # Date 1299940042 -3600 # Node ID c32c92fdca5bf58390078ed4ff0ac74b2e9162c0 # Parent e698be84c22d4f0bb1ebc51487853e1db3b43a95 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. diff --git a/hgsubversion/util.py b/hgsubversion/util.py --- 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):