Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 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 | 02b17231f6c3 |
children | 330c258fe7ca |
comparison
equal
deleted
inserted
replaced
45756:79d681753c4d | 45765:ed84a4d48910 |
---|---|
505 del cfg[b'ui'][k] | 505 del cfg[b'ui'][k] |
506 for k, v in cfg.items(b'defaults'): | 506 for k, v in cfg.items(b'defaults'): |
507 del cfg[b'defaults'][k] | 507 del cfg[b'defaults'][k] |
508 for k, v in cfg.items(b'commands'): | 508 for k, v in cfg.items(b'commands'): |
509 del cfg[b'commands'][k] | 509 del cfg[b'commands'][k] |
510 for k, v in cfg.items(b'command-templates'): | |
511 del cfg[b'command-templates'][k] | |
510 # Don't remove aliases from the configuration if in the exceptionlist | 512 # Don't remove aliases from the configuration if in the exceptionlist |
511 if self.plain(b'alias'): | 513 if self.plain(b'alias'): |
512 for k, v in cfg.items(b'alias'): | 514 for k, v in cfg.items(b'alias'): |
513 del cfg[b'alias'][k] | 515 del cfg[b'alias'][k] |
514 if self.plain(b'revsetalias'): | 516 if self.plain(b'revsetalias'): |