tests/test-command-template.t
changeset 28695 cc103bd0dbf9
parent 28687 29c249dfb4ef
child 28912 867d6ba2353d
--- 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 ..