##// 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 $ hg init a
1 $ hg init a
2 $ hg clone a b
2 $ hg clone a b
3 updating to branch default
3 updating to branch default
4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 $ cd a
5 $ cd a
6
6
7 with no paths:
7 with no paths:
8
8
9 $ hg paths
9 $ hg paths
10 $ hg paths unknown
10 $ hg paths unknown
11 not found!
11 not found!
12 [1]
12 [1]
13 $ hg paths -Tjson
13 $ hg paths -Tjson
14 [
14 [
15 ]
15 ]
16
16
17 with paths:
17 with paths:
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 (glob)
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 (glob)
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 (glob)
34 expand = $TESTTMP/a/$SOMETHING/bar (glob)
34 expand = $TESTTMP/a/$SOMETHING/bar (glob)
35 $ SOMETHING=foo hg paths
35 $ SOMETHING=foo hg paths
36 dupe = $TESTTMP/b#tip (glob)
36 dupe = $TESTTMP/b#tip (glob)
37 expand = $TESTTMP/a/foo/bar (glob)
37 expand = $TESTTMP/a/foo/bar (glob)
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 (glob)
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 (glob)
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 (glob)
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
57 [1]
57 [1]
58
58
59 formatter output with paths:
59 formatter output with paths:
60
60
61 $ echo 'dupe:pushurl = https://example.com/dupe' >> .hg/hgrc
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 "name": "dupe",
65 "name": "dupe",
66 "pushurl": "https://example.com/dupe",
66 "pushurl": "https://example.com/dupe",
67 "url": "$TESTTMP/b#tip"
67 "url": "$TESTTMP/b#tip" (glob)
68 },
68 },
69 {
69 {
70 "name": "expand",
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 "name": "dupe",
77 "name": "dupe",
78 "pushurl": "https://example.com/dupe",
78 "pushurl": "https://example.com/dupe",
79 "url": "$TESTTMP/b#tip"
79 "url": "$TESTTMP/b#tip" (glob)
80 }
80 }
81 ]
81 ]
82 $ hg paths -Tjson -q unknown
82 $ hg paths -Tjson -q unknown
83 [
83 [
84 ]
84 ]
85 [1]
85 [1]
86
86
87 password should be masked in plain output, but not in machine-readable output:
87 password should be masked in plain output, but not in machine-readable output:
88
88
89 $ echo 'insecure = http://foo:insecure@example.com/' >> .hg/hgrc
89 $ echo 'insecure = http://foo:insecure@example.com/' >> .hg/hgrc
90 $ hg paths insecure
90 $ hg paths insecure
91 http://foo:***@example.com/
91 http://foo:***@example.com/
92 $ hg paths -Tjson insecure
92 $ hg paths -Tjson insecure
93 [
93 [
94 {
94 {
95 "name": "insecure",
95 "name": "insecure",
96 "url": "http://foo:insecure@example.com/"
96 "url": "http://foo:insecure@example.com/"
97 }
97 }
98 ]
98 ]
99
99
100 $ cd ..
100 $ cd ..
101
101
102 sub-options for an undeclared path are ignored
102 sub-options for an undeclared path are ignored
103
103
104 $ hg init suboptions
104 $ hg init suboptions
105 $ cd suboptions
105 $ cd suboptions
106
106
107 $ cat > .hg/hgrc << EOF
107 $ cat > .hg/hgrc << EOF
108 > [paths]
108 > [paths]
109 > path0 = https://example.com/path0
109 > path0 = https://example.com/path0
110 > path1:pushurl = https://example.com/path1
110 > path1:pushurl = https://example.com/path1
111 > EOF
111 > EOF
112 $ hg paths
112 $ hg paths
113 path0 = https://example.com/path0
113 path0 = https://example.com/path0
114
114
115 unknown sub-options aren't displayed
115 unknown sub-options aren't displayed
116
116
117 $ cat > .hg/hgrc << EOF
117 $ cat > .hg/hgrc << EOF
118 > [paths]
118 > [paths]
119 > path0 = https://example.com/path0
119 > path0 = https://example.com/path0
120 > path0:foo = https://example.com/path1
120 > path0:foo = https://example.com/path1
121 > EOF
121 > EOF
122
122
123 $ hg paths
123 $ hg paths
124 path0 = https://example.com/path0
124 path0 = https://example.com/path0
125
125
126 :pushurl must be a URL
126 :pushurl must be a URL
127
127
128 $ cat > .hg/hgrc << EOF
128 $ cat > .hg/hgrc << EOF
129 > [paths]
129 > [paths]
130 > default = /path/to/nothing
130 > default = /path/to/nothing
131 > default:pushurl = /not/a/url
131 > default:pushurl = /not/a/url
132 > EOF
132 > EOF
133
133
134 $ hg paths
134 $ hg paths
135 (paths.default:pushurl not a URL; ignoring)
135 (paths.default:pushurl not a URL; ignoring)
136 default = /path/to/nothing
136 default = /path/to/nothing
137
137
138 #fragment is not allowed in :pushurl
138 #fragment is not allowed in :pushurl
139
139
140 $ cat > .hg/hgrc << EOF
140 $ cat > .hg/hgrc << EOF
141 > [paths]
141 > [paths]
142 > default = https://example.com/repo
142 > default = https://example.com/repo
143 > invalid = https://example.com/repo
143 > invalid = https://example.com/repo
144 > invalid:pushurl = https://example.com/repo#branch
144 > invalid:pushurl = https://example.com/repo#branch
145 > EOF
145 > EOF
146
146
147 $ hg paths
147 $ hg paths
148 ("#fragment" in paths.invalid:pushurl not supported; ignoring)
148 ("#fragment" in paths.invalid:pushurl not supported; ignoring)
149 default = https://example.com/repo
149 default = https://example.com/repo
150 invalid = https://example.com/repo
150 invalid = https://example.com/repo
151 invalid:pushurl = https://example.com/repo
151 invalid:pushurl = https://example.com/repo
152
152
153 $ cd ..
153 $ cd ..
154
154
155 'file:' disables [paths] entries for clone destination
155 'file:' disables [paths] entries for clone destination
156
156
157 $ cat >> $HGRCPATH <<EOF
157 $ cat >> $HGRCPATH <<EOF
158 > [paths]
158 > [paths]
159 > gpath1 = http://hg.example.com
159 > gpath1 = http://hg.example.com
160 > EOF
160 > EOF
161
161
162 $ hg clone a gpath1
162 $ hg clone a gpath1
163 abort: cannot create new http repository
163 abort: cannot create new http repository
164 [255]
164 [255]
165
165
166 $ hg clone a file:gpath1
166 $ hg clone a file:gpath1
167 updating to branch default
167 updating to branch default
168 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 $ cd gpath1
169 $ cd gpath1
170 $ hg -q id
170 $ hg -q id
171 000000000000
171 000000000000
172
172
173 $ cd ..
173 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now