##// END OF EJS Templates
templatekw: rename peerpaths to peerurls per naming convention (BC)...
Yuya Nishihara -
r34540:f30e5970 default
parent child Browse files
Show More
@@ -653,10 +653,10 b' def showobsolete(repo, ctx, templ, **arg'
653 return 'obsolete'
653 return 'obsolete'
654 return ''
654 return ''
655
655
656 @templatekeyword('peerpaths')
656 @templatekeyword('peerurls')
657 def showpeerpaths(repo, **args):
657 def showpeerurls(repo, **args):
658 """A dictionary of repository locations defined in the [paths] section
658 """A dictionary of repository locations defined in the [paths] section
659 of your configuration file. (EXPERIMENTAL)"""
659 of your configuration file."""
660 # see commands.paths() for naming of dictionary keys
660 # see commands.paths() for naming of dictionary keys
661 paths = repo.ui.paths
661 paths = repo.ui.paths
662 urls = util.sortdict((k, p.rawloc) for k, p in sorted(paths.iteritems()))
662 urls = util.sortdict((k, p.rawloc) for k, p in sorted(paths.iteritems()))
@@ -88,29 +88,29 b' 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
@@ -126,7 +126,7 b' output:'
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:
General Comments 0
You need to be logged in to leave comments. Login now