From patchwork Sat Apr 15 10:51:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,3] commit: optionally strip quotes from commit template (BC) From: Yuya Nishihara X-Patchwork-Id: 20219 Message-Id: <51323898479b04d2063a.1492253492@mimosa> To: mercurial-devel@mercurial-scm.org Date: Sat, 15 Apr 2017 19:51:32 +0900 # HG changeset patch # User Yuya Nishihara # Date 1488018759 -32400 # Sat Feb 25 19:32:39 2017 +0900 # Node ID 51323898479b04d2063a880c9aecce116d83a6b9 # Parent 911c62c727e9c0d628158a1655c1b69f725d20df commit: optionally strip quotes from commit template (BC) For consistency with the other template options. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2759,6 +2759,7 @@ def commitforceeditor(repo, ctx, subs, f while forms: tmpl = repo.ui.config('committemplate', '.'.join(forms)) if tmpl: + tmpl = templater.unquotestring(tmpl) templatetext = committext = buildcommittemplate( repo, ctx, subs, extramsg, tmpl) break diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -387,12 +387,12 @@ specific template keywords work well $ cat >> .hg/hgrc < [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}