Show More
@@ -653,10 +653,10 b' def showobsolete(repo, ctx, templ, **arg' | |||
|
653 | 653 | return 'obsolete' |
|
654 | 654 | return '' |
|
655 | 655 | |
|
656 |
@templatekeyword('peer |
|
|
657 |
def showpeer |
|
|
656 | @templatekeyword('peerurls') | |
|
657 | def showpeerurls(repo, **args): | |
|
658 | 658 | """A dictionary of repository locations defined in the [paths] section |
|
659 |
of your configuration file. |
|
|
659 | of your configuration file.""" | |
|
660 | 660 | # see commands.paths() for naming of dictionary keys |
|
661 | 661 | paths = repo.ui.paths |
|
662 | 662 | urls = util.sortdict((k, p.rawloc) for k, p in sorted(paths.iteritems())) |
@@ -88,29 +88,29 b' log template:' | |||
|
88 | 88 | |
|
89 | 89 | (behaves as a {name: path-string} dict by default) |
|
90 | 90 | |
|
91 |
$ hg log -rnull -T '{peer |
|
|
91 | $ hg log -rnull -T '{peerurls}\n' | |
|
92 | 92 | dupe=$TESTTMP/b#tip expand=$TESTTMP/a/$SOMETHING/bar (glob) |
|
93 |
$ hg log -rnull -T '{join(peer |
|
|
93 | $ hg log -rnull -T '{join(peerurls, "\n")}\n' | |
|
94 | 94 | dupe=$TESTTMP/b#tip (glob) |
|
95 | 95 | expand=$TESTTMP/a/$SOMETHING/bar (glob) |
|
96 |
$ hg log -rnull -T '{peer |
|
|
96 | $ hg log -rnull -T '{peerurls % "{name}: {url}\n"}' | |
|
97 | 97 | dupe: $TESTTMP/b#tip (glob) |
|
98 | 98 | expand: $TESTTMP/a/$SOMETHING/bar (glob) |
|
99 |
$ hg log -rnull -T '{get(peer |
|
|
99 | $ hg log -rnull -T '{get(peerurls, "dupe")}\n' | |
|
100 | 100 | $TESTTMP/b#tip (glob) |
|
101 | 101 | |
|
102 | 102 | (sub options can be populated by map/dot operation) |
|
103 | 103 | |
|
104 | 104 | $ hg log -rnull \ |
|
105 |
> -T '{get(peer |
|
|
105 | > -T '{get(peerurls, "dupe") % "url: {url}\npushurl: {pushurl}\n"}' | |
|
106 | 106 | url: $TESTTMP/b#tip (glob) |
|
107 | 107 | pushurl: https://example.com/dupe |
|
108 |
$ hg log -rnull -T '{peer |
|
|
108 | $ hg log -rnull -T '{peerurls.dupe.pushurl}\n' | |
|
109 | 109 | https://example.com/dupe |
|
110 | 110 | |
|
111 | 111 | (in JSON, it's a dict of urls) |
|
112 | 112 | |
|
113 |
$ hg log -rnull -T '{peer |
|
|
113 | $ hg log -rnull -T '{peerurls|json}\n' | sed 's|\\\\|/|g' | |
|
114 | 114 | {"dupe": "$TESTTMP/b#tip", "expand": "$TESTTMP/a/$SOMETHING/bar"} |
|
115 | 115 | |
|
116 | 116 | password should be masked in plain output, but not in machine-readable/template |
@@ -126,7 +126,7 b' output:' | |||
|
126 | 126 | "url": "http://foo:insecure@example.com/" |
|
127 | 127 | } |
|
128 | 128 | ] |
|
129 |
$ hg log -rnull -T '{get(peer |
|
|
129 | $ hg log -rnull -T '{get(peerurls, "insecure")}\n' | |
|
130 | 130 | http://foo:insecure@example.com/ |
|
131 | 131 | |
|
132 | 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