Mercurial > public > mercurial-scm > hg-stable
diff tests/test-paths.t @ 34538:ac38e889b33a
templatekw: make experimental {peerpaths} return a single-level dict (BC)
This was planned as in c0d8de2724ce, "{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."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 18 Sep 2017 23:31:01 +0900 |
parents | 8c3dd5e462cc |
children | f30e59703d98 |
line wrap: on
line diff
--- a/tests/test-paths.t Mon Sep 18 23:49:05 2017 +0900 +++ b/tests/test-paths.t Mon Sep 18 23:31:01 2017 +0900 @@ -93,34 +93,25 @@ $ hg log -rnull -T '{join(peerpaths, "\n")}\n' dupe=$TESTTMP/b#tip (glob) expand=$TESTTMP/a/$SOMETHING/bar (glob) - $ hg log -rnull -T '{peerpaths % "{name}: {path}\n"}' + $ hg log -rnull -T '{peerpaths % "{name}: {url}\n"}' dupe: $TESTTMP/b#tip (glob) expand: $TESTTMP/a/$SOMETHING/bar (glob) $ hg log -rnull -T '{get(peerpaths, "dupe")}\n' $TESTTMP/b#tip (glob) - (but a path is actually a dict of url and sub-options) + (sub options can be populated by map/dot operation) - $ hg log -rnull -T '{join(get(peerpaths, "dupe"), "\n")}\n' - url=$TESTTMP/b#tip (glob) - pushurl=https://example.com/dupe - $ hg log -rnull -T '{get(peerpaths, "dupe") % "{key}: {value}\n"}' + $ hg log -rnull \ + > -T '{get(peerpaths, "dupe") % "url: {url}\npushurl: {pushurl}\n"}' url: $TESTTMP/b#tip (glob) pushurl: https://example.com/dupe - $ hg log -rnull -T '{get(get(peerpaths, "dupe"), "pushurl")}\n' + $ hg log -rnull -T '{peerpaths.dupe.pushurl}\n' https://example.com/dupe - (so there's weird behavior) - - $ hg log -rnull -T '{get(peerpaths, "dupe")|count}\n' - 2 - $ hg log -rnull -T '{get(peerpaths, "dupe")|stringify|count}\n' - [0-9]{2,} (re) - - (in JSON, it's a dict of dicts) + (in JSON, it's a dict of urls) $ hg log -rnull -T '{peerpaths|json}\n' | sed 's|\\\\|/|g' - {"dupe": {"pushurl": "https://example.com/dupe", "url": "$TESTTMP/b#tip"}, "expand": {"url": "$TESTTMP/a/$SOMETHING/bar"}} + {"dupe": "$TESTTMP/b#tip", "expand": "$TESTTMP/a/$SOMETHING/bar"} password should be masked in plain output, but not in machine-readable/template output: