# HG changeset patch # User Franz Glasner # Date 1519387136 -3600 # Node ID e02aceb91a9b73a44a3d0a8d685430618e97a43d # Parent f772a6cc2f67044ec15ec19f3bfc13ecf62da8d9 Make "full" a user filter and "none" an alias to "full" diff -r f772a6cc2f67 -r e02aceb91a9b extensions/kwarchive.py --- a/extensions/kwarchive.py Fri Feb 23 12:48:25 2018 +0100 +++ b/extensions/kwarchive.py Fri Feb 23 12:58:56 2018 +0100 @@ -120,7 +120,8 @@ :``user``: the short representation of a user name or email address :``person``: the name before an email address as per RFC 5322 :``email``: the email address - :``none``: the complete user information w/o filtering + :``full``: the complete user information w/o filtering + :``none``: an alias for ``full`` Returns 0 on success. @@ -204,7 +205,8 @@ :``user``: the short representation of a user name or email address :``person``: the name before an email address as per RFC 5322 :``email``: the email address - :``none``: the complete user information w/o filtering + :``full``: the complete user information w/o filtering + :``none``: an alias for ``full`` Use --reST to output the keyword in a format suitable for including in reStructuredText (reST) documents by using it's substitution feature. @@ -368,8 +370,15 @@ keywords["Author"] = templatefilters.utf8(templatefilters.person(ctx.user()).replace(' ', '+')) elif user_filter == "email": keywords["Author"] = templatefilters.email(ctx.user()) - elif user_filter == "none": + elif user_filter in ("full", "none",): + # + # "none" is retained for compatibility reasons and now an + # alias for "full". + # But make it **one** word because that is meant in the RCS spec. + # keywords["Author"] = templatefilters.utf8(ctx.user().replace(' ', '+')) + else: + raise error.Abort(_("unknown user filter")) return keywords @@ -386,6 +395,7 @@ def get_checked_user_filter(opts): uf = opts.get("user_filter") - if not uf in ("person", "user", "email", "none"): + # "none" is retained for compatibility reasons and now an alias for "full" + if not uf in ("person", "user", "email", "full", "none"): raise error.Abort(_("user filter must be any of `user', `person' or `email'")) return uf