Mercurial > hg
comparison tests/test-paths.t @ 34539:f30e59703d98
templatekw: rename peerpaths to peerurls per naming convention (BC)
Since each element is called as "url", the template keyword should be named
as "<whatever>urls".
{peerurls} is now stabilized.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 18 Sep 2017 23:53:05 +0900 |
parents | ac38e889b33a |
children | 4441705b7111 |
comparison
equal
deleted
inserted
replaced
34538:ac38e889b33a | 34539:f30e59703d98 |
---|---|
86 | 86 |
87 log template: | 87 log template: |
88 | 88 |
89 (behaves as a {name: path-string} dict by default) | 89 (behaves as a {name: path-string} dict by default) |
90 | 90 |
91 $ hg log -rnull -T '{peerpaths}\n' | 91 $ hg log -rnull -T '{peerurls}\n' |
92 dupe=$TESTTMP/b#tip expand=$TESTTMP/a/$SOMETHING/bar (glob) | 92 dupe=$TESTTMP/b#tip expand=$TESTTMP/a/$SOMETHING/bar (glob) |
93 $ hg log -rnull -T '{join(peerpaths, "\n")}\n' | 93 $ hg log -rnull -T '{join(peerurls, "\n")}\n' |
94 dupe=$TESTTMP/b#tip (glob) | 94 dupe=$TESTTMP/b#tip (glob) |
95 expand=$TESTTMP/a/$SOMETHING/bar (glob) | 95 expand=$TESTTMP/a/$SOMETHING/bar (glob) |
96 $ hg log -rnull -T '{peerpaths % "{name}: {url}\n"}' | 96 $ hg log -rnull -T '{peerurls % "{name}: {url}\n"}' |
97 dupe: $TESTTMP/b#tip (glob) | 97 dupe: $TESTTMP/b#tip (glob) |
98 expand: $TESTTMP/a/$SOMETHING/bar (glob) | 98 expand: $TESTTMP/a/$SOMETHING/bar (glob) |
99 $ hg log -rnull -T '{get(peerpaths, "dupe")}\n' | 99 $ hg log -rnull -T '{get(peerurls, "dupe")}\n' |
100 $TESTTMP/b#tip (glob) | 100 $TESTTMP/b#tip (glob) |
101 | 101 |
102 (sub options can be populated by map/dot operation) | 102 (sub options can be populated by map/dot operation) |
103 | 103 |
104 $ hg log -rnull \ | 104 $ hg log -rnull \ |
105 > -T '{get(peerpaths, "dupe") % "url: {url}\npushurl: {pushurl}\n"}' | 105 > -T '{get(peerurls, "dupe") % "url: {url}\npushurl: {pushurl}\n"}' |
106 url: $TESTTMP/b#tip (glob) | 106 url: $TESTTMP/b#tip (glob) |
107 pushurl: https://example.com/dupe | 107 pushurl: https://example.com/dupe |
108 $ hg log -rnull -T '{peerpaths.dupe.pushurl}\n' | 108 $ hg log -rnull -T '{peerurls.dupe.pushurl}\n' |
109 https://example.com/dupe | 109 https://example.com/dupe |
110 | 110 |
111 (in JSON, it's a dict of urls) | 111 (in JSON, it's a dict of urls) |
112 | 112 |
113 $ hg log -rnull -T '{peerpaths|json}\n' | sed 's|\\\\|/|g' | 113 $ hg log -rnull -T '{peerurls|json}\n' | sed 's|\\\\|/|g' |
114 {"dupe": "$TESTTMP/b#tip", "expand": "$TESTTMP/a/$SOMETHING/bar"} | 114 {"dupe": "$TESTTMP/b#tip", "expand": "$TESTTMP/a/$SOMETHING/bar"} |
115 | 115 |
116 password should be masked in plain output, but not in machine-readable/template | 116 password should be masked in plain output, but not in machine-readable/template |
117 output: | 117 output: |
118 | 118 |
124 { | 124 { |
125 "name": "insecure", | 125 "name": "insecure", |
126 "url": "http://foo:insecure@example.com/" | 126 "url": "http://foo:insecure@example.com/" |
127 } | 127 } |
128 ] | 128 ] |
129 $ hg log -rnull -T '{get(peerpaths, "insecure")}\n' | 129 $ hg log -rnull -T '{get(peerurls, "insecure")}\n' |
130 http://foo:insecure@example.com/ | 130 http://foo:insecure@example.com/ |
131 | 131 |
132 zeroconf wraps ui.configitems(), which shouldn't crash at least: | 132 zeroconf wraps ui.configitems(), which shouldn't crash at least: |
133 | 133 |
134 $ hg paths --config extensions.zeroconf= | 134 $ hg paths --config extensions.zeroconf= |