##// END OF EJS Templates
tests: skip filelog damage tests when not using revlogs...
Gregory Szorc -
r37362:e1942c19 default
parent child Browse files
Show More
@@ -1,346 +1,350 b''
1 ==================================
1 ==================================
2 Basic testing for the push command
2 Basic testing for the push command
3 ==================================
3 ==================================
4
4
5 Testing of the '--rev' flag
5 Testing of the '--rev' flag
6 ===========================
6 ===========================
7
7
8 $ hg init test-revflag
8 $ hg init test-revflag
9 $ hg -R test-revflag unbundle "$TESTDIR/bundles/remote.hg"
9 $ hg -R test-revflag unbundle "$TESTDIR/bundles/remote.hg"
10 adding changesets
10 adding changesets
11 adding manifests
11 adding manifests
12 adding file changes
12 adding file changes
13 added 9 changesets with 7 changes to 4 files (+1 heads)
13 added 9 changesets with 7 changes to 4 files (+1 heads)
14 new changesets bfaf4b5cbf01:916f1afdef90
14 new changesets bfaf4b5cbf01:916f1afdef90
15 (run 'hg heads' to see heads, 'hg merge' to merge)
15 (run 'hg heads' to see heads, 'hg merge' to merge)
16
16
17 $ for i in 0 1 2 3 4 5 6 7 8; do
17 $ for i in 0 1 2 3 4 5 6 7 8; do
18 > echo
18 > echo
19 > hg init test-revflag-"$i"
19 > hg init test-revflag-"$i"
20 > hg -R test-revflag push -r "$i" test-revflag-"$i"
20 > hg -R test-revflag push -r "$i" test-revflag-"$i"
21 > hg -R test-revflag-"$i" verify
21 > hg -R test-revflag-"$i" verify
22 > done
22 > done
23
23
24 pushing to test-revflag-0
24 pushing to test-revflag-0
25 searching for changes
25 searching for changes
26 adding changesets
26 adding changesets
27 adding manifests
27 adding manifests
28 adding file changes
28 adding file changes
29 added 1 changesets with 1 changes to 1 files
29 added 1 changesets with 1 changes to 1 files
30 checking changesets
30 checking changesets
31 checking manifests
31 checking manifests
32 crosschecking files in changesets and manifests
32 crosschecking files in changesets and manifests
33 checking files
33 checking files
34 1 files, 1 changesets, 1 total revisions
34 1 files, 1 changesets, 1 total revisions
35
35
36 pushing to test-revflag-1
36 pushing to test-revflag-1
37 searching for changes
37 searching for changes
38 adding changesets
38 adding changesets
39 adding manifests
39 adding manifests
40 adding file changes
40 adding file changes
41 added 2 changesets with 2 changes to 1 files
41 added 2 changesets with 2 changes to 1 files
42 checking changesets
42 checking changesets
43 checking manifests
43 checking manifests
44 crosschecking files in changesets and manifests
44 crosschecking files in changesets and manifests
45 checking files
45 checking files
46 1 files, 2 changesets, 2 total revisions
46 1 files, 2 changesets, 2 total revisions
47
47
48 pushing to test-revflag-2
48 pushing to test-revflag-2
49 searching for changes
49 searching for changes
50 adding changesets
50 adding changesets
51 adding manifests
51 adding manifests
52 adding file changes
52 adding file changes
53 added 3 changesets with 3 changes to 1 files
53 added 3 changesets with 3 changes to 1 files
54 checking changesets
54 checking changesets
55 checking manifests
55 checking manifests
56 crosschecking files in changesets and manifests
56 crosschecking files in changesets and manifests
57 checking files
57 checking files
58 1 files, 3 changesets, 3 total revisions
58 1 files, 3 changesets, 3 total revisions
59
59
60 pushing to test-revflag-3
60 pushing to test-revflag-3
61 searching for changes
61 searching for changes
62 adding changesets
62 adding changesets
63 adding manifests
63 adding manifests
64 adding file changes
64 adding file changes
65 added 4 changesets with 4 changes to 1 files
65 added 4 changesets with 4 changes to 1 files
66 checking changesets
66 checking changesets
67 checking manifests
67 checking manifests
68 crosschecking files in changesets and manifests
68 crosschecking files in changesets and manifests
69 checking files
69 checking files
70 1 files, 4 changesets, 4 total revisions
70 1 files, 4 changesets, 4 total revisions
71
71
72 pushing to test-revflag-4
72 pushing to test-revflag-4
73 searching for changes
73 searching for changes
74 adding changesets
74 adding changesets
75 adding manifests
75 adding manifests
76 adding file changes
76 adding file changes
77 added 2 changesets with 2 changes to 1 files
77 added 2 changesets with 2 changes to 1 files
78 checking changesets
78 checking changesets
79 checking manifests
79 checking manifests
80 crosschecking files in changesets and manifests
80 crosschecking files in changesets and manifests
81 checking files
81 checking files
82 1 files, 2 changesets, 2 total revisions
82 1 files, 2 changesets, 2 total revisions
83
83
84 pushing to test-revflag-5
84 pushing to test-revflag-5
85 searching for changes
85 searching for changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 3 changesets with 3 changes to 1 files
89 added 3 changesets with 3 changes to 1 files
90 checking changesets
90 checking changesets
91 checking manifests
91 checking manifests
92 crosschecking files in changesets and manifests
92 crosschecking files in changesets and manifests
93 checking files
93 checking files
94 1 files, 3 changesets, 3 total revisions
94 1 files, 3 changesets, 3 total revisions
95
95
96 pushing to test-revflag-6
96 pushing to test-revflag-6
97 searching for changes
97 searching for changes
98 adding changesets
98 adding changesets
99 adding manifests
99 adding manifests
100 adding file changes
100 adding file changes
101 added 4 changesets with 5 changes to 2 files
101 added 4 changesets with 5 changes to 2 files
102 checking changesets
102 checking changesets
103 checking manifests
103 checking manifests
104 crosschecking files in changesets and manifests
104 crosschecking files in changesets and manifests
105 checking files
105 checking files
106 2 files, 4 changesets, 5 total revisions
106 2 files, 4 changesets, 5 total revisions
107
107
108 pushing to test-revflag-7
108 pushing to test-revflag-7
109 searching for changes
109 searching for changes
110 adding changesets
110 adding changesets
111 adding manifests
111 adding manifests
112 adding file changes
112 adding file changes
113 added 5 changesets with 6 changes to 3 files
113 added 5 changesets with 6 changes to 3 files
114 checking changesets
114 checking changesets
115 checking manifests
115 checking manifests
116 crosschecking files in changesets and manifests
116 crosschecking files in changesets and manifests
117 checking files
117 checking files
118 3 files, 5 changesets, 6 total revisions
118 3 files, 5 changesets, 6 total revisions
119
119
120 pushing to test-revflag-8
120 pushing to test-revflag-8
121 searching for changes
121 searching for changes
122 adding changesets
122 adding changesets
123 adding manifests
123 adding manifests
124 adding file changes
124 adding file changes
125 added 5 changesets with 5 changes to 2 files
125 added 5 changesets with 5 changes to 2 files
126 checking changesets
126 checking changesets
127 checking manifests
127 checking manifests
128 crosschecking files in changesets and manifests
128 crosschecking files in changesets and manifests
129 checking files
129 checking files
130 2 files, 5 changesets, 5 total revisions
130 2 files, 5 changesets, 5 total revisions
131
131
132 $ cd test-revflag-8
132 $ cd test-revflag-8
133
133
134 $ hg pull ../test-revflag-7
134 $ hg pull ../test-revflag-7
135 pulling from ../test-revflag-7
135 pulling from ../test-revflag-7
136 searching for changes
136 searching for changes
137 adding changesets
137 adding changesets
138 adding manifests
138 adding manifests
139 adding file changes
139 adding file changes
140 added 4 changesets with 2 changes to 3 files (+1 heads)
140 added 4 changesets with 2 changes to 3 files (+1 heads)
141 new changesets c70afb1ee985:faa2e4234c7a
141 new changesets c70afb1ee985:faa2e4234c7a
142 (run 'hg heads' to see heads, 'hg merge' to merge)
142 (run 'hg heads' to see heads, 'hg merge' to merge)
143
143
144 $ hg verify
144 $ hg verify
145 checking changesets
145 checking changesets
146 checking manifests
146 checking manifests
147 crosschecking files in changesets and manifests
147 crosschecking files in changesets and manifests
148 checking files
148 checking files
149 4 files, 9 changesets, 7 total revisions
149 4 files, 9 changesets, 7 total revisions
150
150
151 $ cd ..
151 $ cd ..
152
152
153 Test server side validation during push
153 Test server side validation during push
154 =======================================
154 =======================================
155
155
156 $ hg init test-validation
156 $ hg init test-validation
157 $ cd test-validation
157 $ cd test-validation
158
158
159 $ cat > .hg/hgrc <<EOF
159 $ cat > .hg/hgrc <<EOF
160 > [server]
160 > [server]
161 > validate=1
161 > validate=1
162 > EOF
162 > EOF
163
163
164 $ echo alpha > alpha
164 $ echo alpha > alpha
165 $ echo beta > beta
165 $ echo beta > beta
166 $ hg addr
166 $ hg addr
167 adding alpha
167 adding alpha
168 adding beta
168 adding beta
169 $ hg ci -m 1
169 $ hg ci -m 1
170
170
171 $ cd ..
171 $ cd ..
172 $ hg clone test-validation test-validation-clone
172 $ hg clone test-validation test-validation-clone
173 updating to branch default
173 updating to branch default
174 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
175
175
176 #if reporevlogstore
177
176 Test spurious filelog entries:
178 Test spurious filelog entries:
177
179
178 $ cd test-validation-clone
180 $ cd test-validation-clone
179 $ echo blah >> beta
181 $ echo blah >> beta
180 $ cp .hg/store/data/beta.i tmp1
182 $ cp .hg/store/data/beta.i tmp1
181 $ hg ci -m 2
183 $ hg ci -m 2
182 $ cp .hg/store/data/beta.i tmp2
184 $ cp .hg/store/data/beta.i tmp2
183 $ hg -q rollback
185 $ hg -q rollback
184 $ mv tmp2 .hg/store/data/beta.i
186 $ mv tmp2 .hg/store/data/beta.i
185 $ echo blah >> beta
187 $ echo blah >> beta
186 $ hg ci -m '2 (corrupt)'
188 $ hg ci -m '2 (corrupt)'
187
189
188 Expected to fail:
190 Expected to fail:
189
191
190 $ hg verify
192 $ hg verify
191 checking changesets
193 checking changesets
192 checking manifests
194 checking manifests
193 crosschecking files in changesets and manifests
195 crosschecking files in changesets and manifests
194 checking files
196 checking files
195 beta@1: dddc47b3ba30 not in manifests
197 beta@1: dddc47b3ba30 not in manifests
196 2 files, 2 changesets, 4 total revisions
198 2 files, 2 changesets, 4 total revisions
197 1 integrity errors encountered!
199 1 integrity errors encountered!
198 (first damaged changeset appears to be 1)
200 (first damaged changeset appears to be 1)
199 [1]
201 [1]
200
202
201 $ hg push
203 $ hg push
202 pushing to $TESTTMP/test-validation
204 pushing to $TESTTMP/test-validation
203 searching for changes
205 searching for changes
204 adding changesets
206 adding changesets
205 adding manifests
207 adding manifests
206 adding file changes
208 adding file changes
207 transaction abort!
209 transaction abort!
208 rollback completed
210 rollback completed
209 abort: received spurious file revlog entry
211 abort: received spurious file revlog entry
210 [255]
212 [255]
211
213
212 $ hg -q rollback
214 $ hg -q rollback
213 $ mv tmp1 .hg/store/data/beta.i
215 $ mv tmp1 .hg/store/data/beta.i
214 $ echo beta > beta
216 $ echo beta > beta
215
217
216 Test missing filelog entries:
218 Test missing filelog entries:
217
219
218 $ cp .hg/store/data/beta.i tmp
220 $ cp .hg/store/data/beta.i tmp
219 $ echo blah >> beta
221 $ echo blah >> beta
220 $ hg ci -m '2 (corrupt)'
222 $ hg ci -m '2 (corrupt)'
221 $ mv tmp .hg/store/data/beta.i
223 $ mv tmp .hg/store/data/beta.i
222
224
223 Expected to fail:
225 Expected to fail:
224
226
225 $ hg verify
227 $ hg verify
226 checking changesets
228 checking changesets
227 checking manifests
229 checking manifests
228 crosschecking files in changesets and manifests
230 crosschecking files in changesets and manifests
229 checking files
231 checking files
230 beta@1: manifest refers to unknown revision dddc47b3ba30
232 beta@1: manifest refers to unknown revision dddc47b3ba30
231 2 files, 2 changesets, 2 total revisions
233 2 files, 2 changesets, 2 total revisions
232 1 integrity errors encountered!
234 1 integrity errors encountered!
233 (first damaged changeset appears to be 1)
235 (first damaged changeset appears to be 1)
234 [1]
236 [1]
235
237
236 $ hg push
238 $ hg push
237 pushing to $TESTTMP/test-validation
239 pushing to $TESTTMP/test-validation
238 searching for changes
240 searching for changes
239 adding changesets
241 adding changesets
240 adding manifests
242 adding manifests
241 adding file changes
243 adding file changes
242 transaction abort!
244 transaction abort!
243 rollback completed
245 rollback completed
244 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
246 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
245 [255]
247 [255]
246
248
247 $ cd ..
249 $ cd ..
248
250
251 #endif
252
249 Test push hook locking
253 Test push hook locking
250 =====================
254 =====================
251
255
252 $ hg init 1
256 $ hg init 1
253
257
254 $ echo '[ui]' >> 1/.hg/hgrc
258 $ echo '[ui]' >> 1/.hg/hgrc
255 $ echo 'timeout = 10' >> 1/.hg/hgrc
259 $ echo 'timeout = 10' >> 1/.hg/hgrc
256
260
257 $ echo foo > 1/foo
261 $ echo foo > 1/foo
258 $ hg --cwd 1 ci -A -m foo
262 $ hg --cwd 1 ci -A -m foo
259 adding foo
263 adding foo
260
264
261 $ hg clone 1 2
265 $ hg clone 1 2
262 updating to branch default
266 updating to branch default
263 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
264
268
265 $ hg clone 2 3
269 $ hg clone 2 3
266 updating to branch default
270 updating to branch default
267 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
268
272
269 $ cat <<EOF > $TESTTMP/debuglocks-pretxn-hook.sh
273 $ cat <<EOF > $TESTTMP/debuglocks-pretxn-hook.sh
270 > hg debuglocks
274 > hg debuglocks
271 > true
275 > true
272 > EOF
276 > EOF
273 $ echo '[hooks]' >> 2/.hg/hgrc
277 $ echo '[hooks]' >> 2/.hg/hgrc
274 $ echo "pretxnchangegroup.a = sh $TESTTMP/debuglocks-pretxn-hook.sh" >> 2/.hg/hgrc
278 $ echo "pretxnchangegroup.a = sh $TESTTMP/debuglocks-pretxn-hook.sh" >> 2/.hg/hgrc
275 $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
279 $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc
276
280
277 $ echo bar >> 3/foo
281 $ echo bar >> 3/foo
278 $ hg --cwd 3 ci -m bar
282 $ hg --cwd 3 ci -m bar
279
283
280 $ hg --cwd 3 push ../2 --config devel.legacy.exchange=bundle1
284 $ hg --cwd 3 push ../2 --config devel.legacy.exchange=bundle1
281 pushing to ../2
285 pushing to ../2
282 searching for changes
286 searching for changes
283 adding changesets
287 adding changesets
284 adding manifests
288 adding manifests
285 adding file changes
289 adding file changes
286 added 1 changesets with 1 changes to 1 files
290 added 1 changesets with 1 changes to 1 files
287 lock: user *, process * (*s) (glob)
291 lock: user *, process * (*s) (glob)
288 wlock: free
292 wlock: free
289
293
290 $ hg --cwd 1 --config extensions.strip= strip tip -q
294 $ hg --cwd 1 --config extensions.strip= strip tip -q
291 $ hg --cwd 2 --config extensions.strip= strip tip -q
295 $ hg --cwd 2 --config extensions.strip= strip tip -q
292 $ hg --cwd 3 push ../2 # bundle2+
296 $ hg --cwd 3 push ../2 # bundle2+
293 pushing to ../2
297 pushing to ../2
294 searching for changes
298 searching for changes
295 adding changesets
299 adding changesets
296 adding manifests
300 adding manifests
297 adding file changes
301 adding file changes
298 added 1 changesets with 1 changes to 1 files
302 added 1 changesets with 1 changes to 1 files
299 lock: user *, process * (*s) (glob)
303 lock: user *, process * (*s) (glob)
300 wlock: user *, process * (*s) (glob)
304 wlock: user *, process * (*s) (glob)
301
305
302 Test bare push with multiple race checking options
306 Test bare push with multiple race checking options
303 --------------------------------------------------
307 --------------------------------------------------
304
308
305 $ hg init test-bare-push-no-concurrency
309 $ hg init test-bare-push-no-concurrency
306 $ hg init test-bare-push-unrelated-concurrency
310 $ hg init test-bare-push-unrelated-concurrency
307 $ hg -R test-revflag push -r 0 test-bare-push-no-concurrency --config server.concurrent-push-mode=strict
311 $ hg -R test-revflag push -r 0 test-bare-push-no-concurrency --config server.concurrent-push-mode=strict
308 pushing to test-bare-push-no-concurrency
312 pushing to test-bare-push-no-concurrency
309 searching for changes
313 searching for changes
310 adding changesets
314 adding changesets
311 adding manifests
315 adding manifests
312 adding file changes
316 adding file changes
313 added 1 changesets with 1 changes to 1 files
317 added 1 changesets with 1 changes to 1 files
314 $ hg -R test-revflag push -r 0 test-bare-push-unrelated-concurrency --config server.concurrent-push-mode=check-related
318 $ hg -R test-revflag push -r 0 test-bare-push-unrelated-concurrency --config server.concurrent-push-mode=check-related
315 pushing to test-bare-push-unrelated-concurrency
319 pushing to test-bare-push-unrelated-concurrency
316 searching for changes
320 searching for changes
317 adding changesets
321 adding changesets
318 adding manifests
322 adding manifests
319 adding file changes
323 adding file changes
320 added 1 changesets with 1 changes to 1 files
324 added 1 changesets with 1 changes to 1 files
321
325
322 SEC: check for unsafe ssh url
326 SEC: check for unsafe ssh url
323
327
324 $ cat >> $HGRCPATH << EOF
328 $ cat >> $HGRCPATH << EOF
325 > [ui]
329 > [ui]
326 > ssh = sh -c "read l; read l; read l"
330 > ssh = sh -c "read l; read l; read l"
327 > EOF
331 > EOF
328
332
329 $ hg -R test-revflag push 'ssh://-oProxyCommand=touch${IFS}owned/path'
333 $ hg -R test-revflag push 'ssh://-oProxyCommand=touch${IFS}owned/path'
330 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
334 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
331 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
335 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
332 [255]
336 [255]
333 $ hg -R test-revflag push 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
337 $ hg -R test-revflag push 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
334 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
338 pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path
335 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
339 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
336 [255]
340 [255]
337 $ hg -R test-revflag push 'ssh://fakehost|touch${IFS}owned/path'
341 $ hg -R test-revflag push 'ssh://fakehost|touch${IFS}owned/path'
338 pushing to ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
342 pushing to ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path
339 abort: no suitable response from remote hg!
343 abort: no suitable response from remote hg!
340 [255]
344 [255]
341 $ hg -R test-revflag push 'ssh://fakehost%7Ctouch%20owned/path'
345 $ hg -R test-revflag push 'ssh://fakehost%7Ctouch%20owned/path'
342 pushing to ssh://fakehost%7Ctouch%20owned/path
346 pushing to ssh://fakehost%7Ctouch%20owned/path
343 abort: no suitable response from remote hg!
347 abort: no suitable response from remote hg!
344 [255]
348 [255]
345
349
346 $ [ ! -f owned ] || echo 'you got owned'
350 $ [ ! -f owned ] || echo 'you got owned'
General Comments 0
You need to be logged in to leave comments. Login now