comparison tests/test-log.t @ 45765:ed84a4d48910

config: add a new [command-templates] section for templates defined by hg The existing `[templates]` section lets the user define their own keys and then refer to them on the command line with `-T`. There are many cases where hg wants to use a user-defined template with a given name, such as `ui.logtemplate` and `ui.mergemarkertemplate`. This patch starts moving such configs in a common section by moving `ui.logtemplate` to `command-templates.log` (with an alias from the old name, of course). Differential Revision: https://phab.mercurial-scm.org/D9245
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 23 Oct 2020 10:56:18 -0700
parents 5f0eeda2005d
children fc4fb2f17dd4
comparison
equal deleted inserted replaced
45756:79d681753c4d 45765:ed84a4d48910
448 files: a f 448 files: a f
449 description: 449 description:
450 a 450 a
451 451
452 452
453 Respects ui.logtemplate and command-templates.log configs (the latter takes
454 precedence)
455
456 $ hg log -r 0 --config ui.logtemplate="foo {rev}\n"
457 foo 0
458 $ hg log -r 0 --config command-templates.log="bar {rev}\n"
459 bar 0
460 $ hg log -r 0 --config ui.logtemplate="foo {rev}\n" \
461 > --config command-templates.log="bar {rev}\n"
462 bar 0
453 463
454 464
455 -f and multiple filelog heads 465 -f and multiple filelog heads
456 466
457 $ hg up -q 2 467 $ hg up -q 2
1120 (issue5376, issue6124) 1130 (issue5376, issue6124)
1121 1131
1122 $ hg init follow-dup 1132 $ hg init follow-dup
1123 $ cd follow-dup 1133 $ cd follow-dup
1124 $ cat <<EOF >> .hg/hgrc 1134 $ cat <<EOF >> .hg/hgrc
1125 > [ui] 1135 > [command-templates]
1126 > logtemplate = '=== {rev}: {desc}\n' 1136 > log = '=== {rev}: {desc}\n'
1127 > [diff] 1137 > [diff]
1128 > nodates = True 1138 > nodates = True
1129 > EOF 1139 > EOF
1130 $ echo 0 >> a 1140 $ echo 0 >> a
1131 $ hg ci -qAm 'a0' 1141 $ hg ci -qAm 'a0'