Mercurial > hg
changeset 33476:c0d8de2724ce
templatekw: hide {peerpaths} keyword for 4.3
Thinking a bit further about list/dict subscript operation (proposed by
issue 5534), I noticed the current data structure, a dict of dicts, might
not be ideal.
For example, if there were "'[' index ']'" and "'.' key" operators,
"{parents[0]}" would return "{p1rev}:{p1node}", and we would probably want to
write "{parents[0].desc}" to get the first element of "{parents % "{desc}"}".
This will basically execute parents[0].makemap()['desc'] in Python.
Given the rule above, "{peerpaths.default.pushurl}" will be translated to
peerpaths['default'].makemap()['pushurl'], which means {peerpaths} should
be a single-level dict and sub-options should be makemap()-ed.
"{peerpaths % "{name} = {url}, {pushurl}, ..."}"
(Well, it could be peerpaths['default']['pushurl'], but in which case,
peerpaths['default'] should be a plain dict, not a hybrid object.)
So, let's mark the current implementation experimental and revisit it later.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 15 Jul 2017 00:38:57 +0900 |
parents | f501322512b6 |
children | cc4632679cf9 |
files | mercurial/templatekw.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templatekw.py Fri Jul 14 13:48:17 2017 +0200 +++ b/mercurial/templatekw.py Sat Jul 15 00:38:57 2017 +0900 @@ -596,7 +596,7 @@ @templatekeyword('peerpaths') def showpeerpaths(repo, **args): """A dictionary of repository locations defined in the [paths] section - of your configuration file.""" + of your configuration file. (EXPERIMENTAL)""" # see commands.paths() for naming of dictionary keys paths = util.sortdict() for k, p in sorted(repo.ui.paths.iteritems()):