commit: optionally strip quotes from commit template (BC)
authorYuya Nishihara <yuya@tcha.org>
Sat, 25 Feb 2017 19:32:39 +0900
changeset 32046 5b630f2ccb4e
parent 32045 3eceeede26e9
child 32047 458f7294dfee
commit: optionally strip quotes from commit template (BC) For consistency with the other template options.
mercurial/cmdutil.py
tests/test-commit.t
--- a/mercurial/cmdutil.py	Sat Feb 25 19:28:16 2017 +0900
+++ b/mercurial/cmdutil.py	Sat Feb 25 19:32:39 2017 +0900
@@ -2768,6 +2768,7 @@
     while forms:
         tmpl = repo.ui.config('committemplate', '.'.join(forms))
         if tmpl:
+            tmpl = templater.unquotestring(tmpl)
             templatetext = committext = buildcommittemplate(
                 repo, ctx, subs, extramsg, tmpl)
             break
--- a/tests/test-commit.t	Sat Feb 25 19:28:16 2017 +0900
+++ b/tests/test-commit.t	Sat Feb 25 19:32:39 2017 +0900
@@ -387,12 +387,12 @@
 
   $ cat >> .hg/hgrc <<EOF
   > [committemplate]
-  > changeset.commit.normal = HG: this is "commit.normal" template
+  > changeset.commit.normal = 'HG: this is "commit.normal" template
   >     HG: {extramsg}
   >     {if(activebookmark,
   >    "HG: bookmark '{activebookmark}' is activated\n",
   >    "HG: no bookmark is activated\n")}{subrepos %
-  >    "HG: subrepo '{subrepo}' is changed\n"}
+  >    "HG: subrepo '{subrepo}' is changed\n"}'
   > 
   > changeset.commit = HG: this is "commit" template
   >     HG: {extramsg}