--- a/tests/test-command-template.t Wed Mar 30 02:10:44 2016 +0900
+++ b/tests/test-command-template.t Wed Mar 30 02:10:44 2016 +0900
@@ -3693,3 +3693,26 @@
[255]
$ cd ..
+
+Test that template function in extension is registered as expected
+
+ $ cd a
+
+ $ cat <<EOF > $TESTTMP/customfunc.py
+ > from mercurial import registrar
+ >
+ > templatefunc = registrar.templatefunc()
+ >
+ > @templatefunc('custom()')
+ > def custom(context, mapping, args):
+ > return 'custom'
+ > EOF
+ $ cat <<EOF > .hg/hgrc
+ > [extensions]
+ > customfunc = $TESTTMP/customfunc.py
+ > EOF
+
+ $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true
+ custom
+
+ $ cd ..