开发者

write custom log keyword filter as extension in mercurial

I have checked the tutorial on 开发者_Python百科how to write a mercurial extension and I wonder how do I do to specifically add a filter for log keywords?

Thanks for help.


I think an example will explain it best:

from mercurial import templatefilters

def upper(s):
    return s.upper()

def extsetup(ui):
    templatefilters.filters["upper"] = upper

# Then run:
#
#   hg tip --config extensions.upper=~/tmp/upper.py --template "{author|upper}\n"
#
# to test

(shamelessly stolen from mg, I hope he forgives me ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜