diff mercurial/help/templates.txt @ 34535:78590585c0db

templater: add dot operator to easily access a sub item This and the next patch will allow us to access a deeply-nested item by foo.bar.baz syntax.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Sep 2017 19:32:56 +0900
parents 61b60b28c381
children 4c1cfe54c08d
line wrap: on
line diff
--- a/mercurial/help/templates.txt	Sat Sep 09 19:13:25 2017 +0900
+++ b/mercurial/help/templates.txt	Sat Sep 09 19:32:56 2017 +0900
@@ -72,6 +72,11 @@
 To prevent it from being interpreted, you can use an escape character ``\{``
 or a raw string prefix, ``r'...'``.
 
+The dot operator can be used as a shorthand for accessing a sub item:
+
+- ``expr.member`` is roughly equivalent to ``expr % "{member}"`` if ``expr``
+  returns a non-list/dict. The returned value is not stringified.
+
 Aliases
 =======