##// END OF EJS Templates
test-paths: fix up json output to match $TESTTMP on Windows...
Matt Harbison -
r28173:1ff28873 default
parent child Browse files
Show More
@@ -1,173 +1,173 b''
1 1 $ hg init a
2 2 $ hg clone a b
3 3 updating to branch default
4 4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 5 $ cd a
6 6
7 7 with no paths:
8 8
9 9 $ hg paths
10 10 $ hg paths unknown
11 11 not found!
12 12 [1]
13 13 $ hg paths -Tjson
14 14 [
15 15 ]
16 16
17 17 with paths:
18 18
19 19 $ echo '[paths]' >> .hg/hgrc
20 20 $ echo 'dupe = ../b#tip' >> .hg/hgrc
21 21 $ echo 'expand = $SOMETHING/bar' >> .hg/hgrc
22 22 $ hg in dupe
23 23 comparing with $TESTTMP/b (glob)
24 24 no changes found
25 25 [1]
26 26 $ cd ..
27 27 $ hg -R a in dupe
28 28 comparing with $TESTTMP/b (glob)
29 29 no changes found
30 30 [1]
31 31 $ cd a
32 32 $ hg paths
33 33 dupe = $TESTTMP/b#tip (glob)
34 34 expand = $TESTTMP/a/$SOMETHING/bar (glob)
35 35 $ SOMETHING=foo hg paths
36 36 dupe = $TESTTMP/b#tip (glob)
37 37 expand = $TESTTMP/a/foo/bar (glob)
38 38 #if msys
39 39 $ SOMETHING=//foo hg paths
40 40 dupe = $TESTTMP/b#tip (glob)
41 41 expand = /foo/bar
42 42 #else
43 43 $ SOMETHING=/foo hg paths
44 44 dupe = $TESTTMP/b#tip (glob)
45 45 expand = /foo/bar
46 46 #endif
47 47 $ hg paths -q
48 48 dupe
49 49 expand
50 50 $ hg paths dupe
51 51 $TESTTMP/b#tip (glob)
52 52 $ hg paths -q dupe
53 53 $ hg paths unknown
54 54 not found!
55 55 [1]
56 56 $ hg paths -q unknown
57 57 [1]
58 58
59 59 formatter output with paths:
60 60
61 61 $ echo 'dupe:pushurl = https://example.com/dupe' >> .hg/hgrc
62 $ hg paths -Tjson
62 $ hg paths -Tjson | sed 's|\\\\|\\|g'
63 63 [
64 64 {
65 65 "name": "dupe",
66 66 "pushurl": "https://example.com/dupe",
67 "url": "$TESTTMP/b#tip"
67 "url": "$TESTTMP/b#tip" (glob)
68 68 },
69 69 {
70 70 "name": "expand",
71 "url": "$TESTTMP/a/$SOMETHING/bar"
71 "url": "$TESTTMP/a/$SOMETHING/bar" (glob)
72 72 }
73 73 ]
74 $ hg paths -Tjson dupe
74 $ hg paths -Tjson dupe | sed 's|\\\\|\\|g'
75 75 [
76 76 {
77 77 "name": "dupe",
78 78 "pushurl": "https://example.com/dupe",
79 "url": "$TESTTMP/b#tip"
79 "url": "$TESTTMP/b#tip" (glob)
80 80 }
81 81 ]
82 82 $ hg paths -Tjson -q unknown
83 83 [
84 84 ]
85 85 [1]
86 86
87 87 password should be masked in plain output, but not in machine-readable output:
88 88
89 89 $ echo 'insecure = http://foo:insecure@example.com/' >> .hg/hgrc
90 90 $ hg paths insecure
91 91 http://foo:***@example.com/
92 92 $ hg paths -Tjson insecure
93 93 [
94 94 {
95 95 "name": "insecure",
96 96 "url": "http://foo:insecure@example.com/"
97 97 }
98 98 ]
99 99
100 100 $ cd ..
101 101
102 102 sub-options for an undeclared path are ignored
103 103
104 104 $ hg init suboptions
105 105 $ cd suboptions
106 106
107 107 $ cat > .hg/hgrc << EOF
108 108 > [paths]
109 109 > path0 = https://example.com/path0
110 110 > path1:pushurl = https://example.com/path1
111 111 > EOF
112 112 $ hg paths
113 113 path0 = https://example.com/path0
114 114
115 115 unknown sub-options aren't displayed
116 116
117 117 $ cat > .hg/hgrc << EOF
118 118 > [paths]
119 119 > path0 = https://example.com/path0
120 120 > path0:foo = https://example.com/path1
121 121 > EOF
122 122
123 123 $ hg paths
124 124 path0 = https://example.com/path0
125 125
126 126 :pushurl must be a URL
127 127
128 128 $ cat > .hg/hgrc << EOF
129 129 > [paths]
130 130 > default = /path/to/nothing
131 131 > default:pushurl = /not/a/url
132 132 > EOF
133 133
134 134 $ hg paths
135 135 (paths.default:pushurl not a URL; ignoring)
136 136 default = /path/to/nothing
137 137
138 138 #fragment is not allowed in :pushurl
139 139
140 140 $ cat > .hg/hgrc << EOF
141 141 > [paths]
142 142 > default = https://example.com/repo
143 143 > invalid = https://example.com/repo
144 144 > invalid:pushurl = https://example.com/repo#branch
145 145 > EOF
146 146
147 147 $ hg paths
148 148 ("#fragment" in paths.invalid:pushurl not supported; ignoring)
149 149 default = https://example.com/repo
150 150 invalid = https://example.com/repo
151 151 invalid:pushurl = https://example.com/repo
152 152
153 153 $ cd ..
154 154
155 155 'file:' disables [paths] entries for clone destination
156 156
157 157 $ cat >> $HGRCPATH <<EOF
158 158 > [paths]
159 159 > gpath1 = http://hg.example.com
160 160 > EOF
161 161
162 162 $ hg clone a gpath1
163 163 abort: cannot create new http repository
164 164 [255]
165 165
166 166 $ hg clone a file:gpath1
167 167 updating to branch default
168 168 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 169 $ cd gpath1
170 170 $ hg -q id
171 171 000000000000
172 172
173 173 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now