changeset 30704:0499da0d5a06

config: add docs for ignoring all text below in the editor This is an example of how to use the new skip-from-there string for ignoring the diff in a commit message.
author Sean Farley <sean@farley.io>
date Wed, 04 Jan 2017 22:32:42 -0600
parents 5c85c93cdd61
children 06b17f6c6559
files mercurial/help/config.txt
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/help/config.txt	Sat Dec 31 15:36:36 2016 -0600
+++ b/mercurial/help/config.txt	Wed Jan 04 22:32:42 2017 -0600
@@ -418,6 +418,28 @@
        "HG: removed {file}\n"                 }{if(files, "",
        "HG: no files changed\n")}
 
+``diff()``
+    String: show the diff (see :hg:`help templates` for detail)
+
+Sometimes it is helpful to show the diff of the changeset in the editor without
+having to prefix 'HG: ' to each line so that highlighting works correctly. For
+this, Mercurial provides a special string which will ignore everything below
+it::
+
+     HG: ------------------------ >8 ------------------------
+
+For example, the template configuration below will show the diff below the
+extra message::
+
+    [committemplate]
+    changeset = {desc}\n\n
+        HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+        HG: {extramsg}
+        HG: ------------------------ >8 ------------------------
+        HG: Do not touch the line above.
+        HG: Everything below will be removed.
+        {diff()}
+
 .. note::
 
    For some problematic encodings (see :hg:`help win32mbcs` for