18 |
18 |
19 $ echo '[paths]' >> .hg/hgrc |
19 $ echo '[paths]' >> .hg/hgrc |
20 $ echo 'dupe = ../b#tip' >> .hg/hgrc |
20 $ echo 'dupe = ../b#tip' >> .hg/hgrc |
21 $ echo 'expand = $SOMETHING/bar' >> .hg/hgrc |
21 $ echo 'expand = $SOMETHING/bar' >> .hg/hgrc |
22 $ hg in dupe |
22 $ hg in dupe |
23 comparing with $TESTTMP/b (glob) |
23 comparing with $TESTTMP/b |
24 no changes found |
24 no changes found |
25 [1] |
25 [1] |
26 $ cd .. |
26 $ cd .. |
27 $ hg -R a in dupe |
27 $ hg -R a in dupe |
28 comparing with $TESTTMP/b (glob) |
28 comparing with $TESTTMP/b |
29 no changes found |
29 no changes found |
30 [1] |
30 [1] |
31 $ cd a |
31 $ cd a |
32 $ hg paths |
32 $ hg paths |
33 dupe = $TESTTMP/b#tip (glob) |
33 dupe = $TESTTMP/b#tip |
34 expand = $TESTTMP/a/$SOMETHING/bar (glob) |
34 expand = $TESTTMP/a/$SOMETHING/bar |
35 $ SOMETHING=foo hg paths |
35 $ SOMETHING=foo hg paths |
36 dupe = $TESTTMP/b#tip (glob) |
36 dupe = $TESTTMP/b#tip |
37 expand = $TESTTMP/a/foo/bar (glob) |
37 expand = $TESTTMP/a/foo/bar |
38 #if msys |
38 #if msys |
39 $ SOMETHING=//foo hg paths |
39 $ SOMETHING=//foo hg paths |
40 dupe = $TESTTMP/b#tip (glob) |
40 dupe = $TESTTMP/b#tip |
41 expand = /foo/bar |
41 expand = /foo/bar |
42 #else |
42 #else |
43 $ SOMETHING=/foo hg paths |
43 $ SOMETHING=/foo hg paths |
44 dupe = $TESTTMP/b#tip (glob) |
44 dupe = $TESTTMP/b#tip |
45 expand = /foo/bar |
45 expand = /foo/bar |
46 #endif |
46 #endif |
47 $ hg paths -q |
47 $ hg paths -q |
48 dupe |
48 dupe |
49 expand |
49 expand |
50 $ hg paths dupe |
50 $ hg paths dupe |
51 $TESTTMP/b#tip (glob) |
51 $TESTTMP/b#tip |
52 $ hg paths -q dupe |
52 $ hg paths -q dupe |
53 $ hg paths unknown |
53 $ hg paths unknown |
54 not found! |
54 not found! |
55 [1] |
55 [1] |
56 $ hg paths -q unknown |
56 $ hg paths -q unknown |
62 $ hg paths -Tjson | sed 's|\\\\|\\|g' |
62 $ hg paths -Tjson | sed 's|\\\\|\\|g' |
63 [ |
63 [ |
64 { |
64 { |
65 "name": "dupe", |
65 "name": "dupe", |
66 "pushurl": "https://example.com/dupe", |
66 "pushurl": "https://example.com/dupe", |
67 "url": "$TESTTMP/b#tip" (glob) |
67 "url": "$TESTTMP/b#tip" |
68 }, |
68 }, |
69 { |
69 { |
70 "name": "expand", |
70 "name": "expand", |
71 "url": "$TESTTMP/a/$SOMETHING/bar" (glob) |
71 "url": "$TESTTMP/a/$SOMETHING/bar" |
72 } |
72 } |
73 ] |
73 ] |
74 $ hg paths -Tjson dupe | sed 's|\\\\|\\|g' |
74 $ hg paths -Tjson dupe | sed 's|\\\\|\\|g' |
75 [ |
75 [ |
76 { |
76 { |
77 "name": "dupe", |
77 "name": "dupe", |
78 "pushurl": "https://example.com/dupe", |
78 "pushurl": "https://example.com/dupe", |
79 "url": "$TESTTMP/b#tip" (glob) |
79 "url": "$TESTTMP/b#tip" |
80 } |
80 } |
81 ] |
81 ] |
82 $ hg paths -Tjson -q unknown |
82 $ hg paths -Tjson -q unknown |
83 [ |
83 [ |
84 ] |
84 ] |
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 '{peerurls}\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 |
93 $ hg log -rnull -T '{join(peerurls, "\n")}\n' |
93 $ hg log -rnull -T '{join(peerurls, "\n")}\n' |
94 dupe=$TESTTMP/b#tip (glob) |
94 dupe=$TESTTMP/b#tip |
95 expand=$TESTTMP/a/$SOMETHING/bar (glob) |
95 expand=$TESTTMP/a/$SOMETHING/bar |
96 $ hg log -rnull -T '{peerurls % "{name}: {url}\n"}' |
96 $ hg log -rnull -T '{peerurls % "{name}: {url}\n"}' |
97 dupe: $TESTTMP/b#tip (glob) |
97 dupe: $TESTTMP/b#tip |
98 expand: $TESTTMP/a/$SOMETHING/bar (glob) |
98 expand: $TESTTMP/a/$SOMETHING/bar |
99 $ hg log -rnull -T '{get(peerurls, "dupe")}\n' |
99 $ hg log -rnull -T '{get(peerurls, "dupe")}\n' |
100 $TESTTMP/b#tip (glob) |
100 $TESTTMP/b#tip |
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(peerurls, "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 |
107 pushurl: https://example.com/dupe |
107 pushurl: https://example.com/dupe |
108 $ hg log -rnull -T '{peerurls.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) |
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= |
135 dupe = $TESTTMP/b#tip (glob) |
135 dupe = $TESTTMP/b#tip |
136 dupe:pushurl = https://example.com/dupe |
136 dupe:pushurl = https://example.com/dupe |
137 expand = $TESTTMP/a/$SOMETHING/bar (glob) |
137 expand = $TESTTMP/a/$SOMETHING/bar |
138 insecure = http://foo:***@example.com/ |
138 insecure = http://foo:***@example.com/ |
139 |
139 |
140 $ cd .. |
140 $ cd .. |
141 |
141 |
142 sub-options for an undeclared path are ignored |
142 sub-options for an undeclared path are ignored |