comparison mercurial/help/config.txt @ 21924:5375ba75df40

cmdutil: make commit message shown in text editor customizable by template This patch makes commit message shown in text editor customizable by template. For example, this can advertise: - sample commit messages for routine works, - points to call attention before commit, - message of the day, and so on To show commit message correctly even in problematic encoding, this patch chooses the latter below: - replace "buildcommittext" with "buildcommittemplate" completely - invoke "buildcommittemplate" only if '[committemplate] changeset' is configured explicitly For example, if multibyte character ending with backslash (0x5c) is followed by ASCII character 'n' in the customized template, sequence of backslash and 'n' is treated as line-feed unexpectedly (and multibyte character is broken, too). This corruption occurs in 'decode("string-escape")' while parsing template string.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 15 Jul 2014 23:34:13 +0900
parents 10abc3a5c6b2
children 9d92b9d1e282 551d776a0a9a
comparison
equal deleted inserted replaced
21923:e582e20cd3e6 21924:5375ba75df40
327 Default: https. 327 Default: https.
328 328
329 If no suitable authentication entry is found, the user is prompted 329 If no suitable authentication entry is found, the user is prompted
330 for credentials as usual if required by the remote. 330 for credentials as usual if required by the remote.
331 331
332
333 ``committemplate``
334 ------------------
335
336 ``changeset`` configuration in this section is used as the template to
337 customize the text shown in the editor when committing.
338
339 In addition to pre-defined template keywords, commit log specific one
340 below can be used for customization:
341
342 ``extramsg``
343 String: Extra message (typically 'Leave message empty to abort
344 commit.'). This may be changed by some commands or extensions.
345
346 For example, the template configuration below shows as same text as
347 one shown by default::
348
349 [committemplate]
350 changeset = {desc}\n\n
351 HG: Enter commit message. Lines beginning with 'HG:' are removed.
352 HG: {extramsg}
353 HG: --
354 HG: user: {author}\n{ifeq(p2rev, "-1", "",
355 "HG: branch merge\n")
356 }HG: branch '{branch}'\n{if(currentbookmark,
357 "HG: bookmark '{currentbookmark}'\n") }{subrepos %
358 "HG: subrepo {subrepo}\n" }{file_adds %
359 "HG: added {file}\n" }{file_mods %
360 "HG: changed {file}\n" }{file_dels %
361 "HG: removed {file}\n" }{if(files, "",
362 "HG: no files changed\n")}
363
364 .. note::
365
366 For some problematic encodings (see :hg:`help win32mbcs` for
367 detail), this customization should be configured carefully, to
368 avoid showing broken characters.
369
370 For example, if multibyte character ending with backslash (0x5c) is
371 followed by ASCII character 'n' in the customized template,
372 sequence of backslash and 'n' is treated as line-feed unexpectedly
373 (and multibyte character is broken, too).
374
375 Customized template is used for commands below (``--edit`` may be
376 required):
377
378 - :hg:`backout`
379 - :hg:`commit`
380 - :hg:`fetch` (for merge commit only)
381 - :hg:`graft`
382 - :hg:`histedit`
383 - :hg:`import`
384 - :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
385 - :hg:`rebase`
386 - :hg:`shelve`
387 - :hg:`sign`
388 - :hg:`tag`
389 - :hg:`transplant`
332 390
333 ``decode/encode`` 391 ``decode/encode``
334 ----------------- 392 -----------------
335 393
336 Filters for transforming files on checkout/checkin. This would 394 Filters for transforming files on checkout/checkin. This would