##// END OF EJS Templates
censor: reduce risk of censor test blowing up output limit...
marmoute -
r48182:65b86f51 default
parent child Browse files
Show More
@@ -52,18 +52,18 b' the second head H2, and so on'
52
52
53 Verify target contents before censorship at each revision
53 Verify target contents before censorship at each revision
54
54
55 $ hg cat -r $H1 target
55 $ hg cat -r $H1 target | head -n 10
56 Tainted file is now sanitized
56 Tainted file is now sanitized
57 $ hg cat -r $H2 target
57 $ hg cat -r $H2 target | head -n 10
58 Tainted file now super sanitized
58 Tainted file now super sanitized
59 $ hg cat -r $C2 target
59 $ hg cat -r $C2 target | head -n 10
60 Tainted file
60 Tainted file
61 Passwords: hunter2
61 Passwords: hunter2
62 hunter3
62 hunter3
63 $ hg cat -r $C1 target
63 $ hg cat -r $C1 target | head -n 10
64 Tainted file
64 Tainted file
65 Passwords: hunter2
65 Passwords: hunter2
66 $ hg cat -r 0 target
66 $ hg cat -r 0 target | head -n 10
67 Initially untainted file
67 Initially untainted file
68
68
69 Try to censor revision with too large of a tombstone message
69 Try to censor revision with too large of a tombstone message
@@ -78,18 +78,17 b' Censor revision with 2 offenses'
78
78
79 $ mkdir -p foo/bar/baz
79 $ mkdir -p foo/bar/baz
80 $ hg --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target
80 $ hg --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target
81 $ hg cat -r $H1 target
81 $ hg cat -r $H1 target | head -n 10
82 Tainted file is now sanitized
82 Tainted file is now sanitized
83 $ hg cat -r $H2 target
83 $ hg cat -r $H2 target | head -n 10
84 Tainted file now super sanitized
84 Tainted file now super sanitized
85 $ hg cat -r $C2 target
85 $ hg cat -r $C2 target | head -n 10
86 abort: censored node: 1e0247a9a4b7
86 abort: censored node: 1e0247a9a4b7
87 (set censor.policy to ignore errors)
87 (set censor.policy to ignore errors)
88 [255]
88 $ hg cat -r $C1 target | head -n 10
89 $ hg cat -r $C1 target
90 Tainted file
89 Tainted file
91 Passwords: hunter2
90 Passwords: hunter2
92 $ hg cat -r 0 target
91 $ hg cat -r 0 target | head -n 10
93 Initially untainted file
92 Initially untainted file
94
93
95 Censor revision with 1 offense
94 Censor revision with 1 offense
@@ -97,31 +96,27 b' Censor revision with 1 offense'
97 (this also tests file pattern matching: with 'path:' scheme)
96 (this also tests file pattern matching: with 'path:' scheme)
98
97
99 $ hg --cwd foo/bar/baz censor -r $C1 path:target
98 $ hg --cwd foo/bar/baz censor -r $C1 path:target
100 $ hg cat -r $H1 target
99 $ hg cat -r $H1 target | head -n 10
101 Tainted file is now sanitized
100 Tainted file is now sanitized
102 $ hg cat -r $H2 target
101 $ hg cat -r $H2 target | head -n 10
103 Tainted file now super sanitized
102 Tainted file now super sanitized
104 $ hg cat -r $C2 target
103 $ hg cat -r $C2 target | head -n 10
105 abort: censored node: 1e0247a9a4b7
104 abort: censored node: 1e0247a9a4b7
106 (set censor.policy to ignore errors)
105 (set censor.policy to ignore errors)
107 [255]
106 $ hg cat -r $C1 target | head -n 10
108 $ hg cat -r $C1 target
109 abort: censored node: 613bc869fceb
107 abort: censored node: 613bc869fceb
110 (set censor.policy to ignore errors)
108 (set censor.policy to ignore errors)
111 [255]
109 $ hg cat -r 0 target | head -n 10
112 $ hg cat -r 0 target
113 Initially untainted file
110 Initially untainted file
114
111
115 Can only checkout target at uncensored revisions, -X is workaround for --all
112 Can only checkout target at uncensored revisions, -X is workaround for --all
116
113
117 $ hg revert -r $C2 target
114 $ hg revert -r $C2 target | head -n 10
118 abort: censored node: 1e0247a9a4b7
115 abort: censored node: 1e0247a9a4b7
119 (set censor.policy to ignore errors)
116 (set censor.policy to ignore errors)
120 [255]
117 $ hg revert -r $C1 target | head -n 10
121 $ hg revert -r $C1 target
122 abort: censored node: 613bc869fceb
118 abort: censored node: 613bc869fceb
123 (set censor.policy to ignore errors)
119 (set censor.policy to ignore errors)
124 [255]
125 $ hg revert -r $C1 --all
120 $ hg revert -r $C1 --all
126 reverting bystander
121 reverting bystander
127 reverting target
122 reverting target
@@ -129,38 +124,38 b' Can only checkout target at uncensored r'
129 (set censor.policy to ignore errors)
124 (set censor.policy to ignore errors)
130 [255]
125 [255]
131 $ hg revert -r $C1 --all -X target
126 $ hg revert -r $C1 --all -X target
132 $ cat target
127 $ cat target | head -n 10
133 Tainted file now super sanitized
128 Tainted file now super sanitized
134 $ hg revert -r 0 --all
129 $ hg revert -r 0 --all
135 reverting target
130 reverting target
136 $ cat target
131 $ cat target | head -n 10
137 Initially untainted file
132 Initially untainted file
138 $ hg revert -r $H2 --all
133 $ hg revert -r $H2 --all
139 reverting bystander
134 reverting bystander
140 reverting target
135 reverting target
141 $ cat target
136 $ cat target | head -n 10
142 Tainted file now super sanitized
137 Tainted file now super sanitized
143
138
144 Uncensored file can be viewed at any revision
139 Uncensored file can be viewed at any revision
145
140
146 $ hg cat -r $H1 bystander
141 $ hg cat -r $H1 bystander | head -n 10
147 Normal file v2
142 Normal file v2
148 $ hg cat -r $C2 bystander
143 $ hg cat -r $C2 bystander | head -n 10
149 Normal file v2
144 Normal file v2
150 $ hg cat -r $C1 bystander
145 $ hg cat -r $C1 bystander | head -n 10
151 Normal file here
146 Normal file here
152 $ hg cat -r 0 bystander
147 $ hg cat -r 0 bystander | head -n 10
153 Normal file here
148 Normal file here
154
149
155 Can update to children of censored revision
150 Can update to children of censored revision
156
151
157 $ hg update -r $H1
152 $ hg update -r $H1
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 $ cat target
154 $ cat target | head -n 10
160 Tainted file is now sanitized
155 Tainted file is now sanitized
161 $ hg update -r $H2
156 $ hg update -r $H2
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 $ cat target
158 $ cat target | head -n 10
164 Tainted file now super sanitized
159 Tainted file now super sanitized
165
160
166 Set censor policy to abort in trusted $HGRC so hg verify fails
161 Set censor policy to abort in trusted $HGRC so hg verify fails
@@ -221,17 +216,17 b' May update to revision with censored dat'
221
216
222 $ hg update -r $C2
217 $ hg update -r $C2
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
218 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 $ cat target
219 $ cat target | head -n 10
225 $ hg update -r $C1
220 $ hg update -r $C1
226 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 $ cat target
222 $ cat target | head -n 10
228 $ hg update -r 0
223 $ hg update -r 0
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 $ cat target
225 $ cat target | head -n 10
231 Initially untainted file
226 Initially untainted file
232 $ hg update -r $H2
227 $ hg update -r $H2
233 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ cat target
229 $ cat target | head -n 10
235 Tainted file now super sanitized
230 Tainted file now super sanitized
236
231
237 Can merge in revision with censored data. Test requires one branch of history
232 Can merge in revision with censored data. Test requires one branch of history
@@ -288,20 +283,19 b' Can re-add file after being deleted + ce'
288 $ hg ci -m 'delete target so it may be censored'
283 $ hg ci -m 'delete target so it may be censored'
289 $ H2=`hg id --debug -i`
284 $ H2=`hg id --debug -i`
290 $ hg censor -r $C4 target
285 $ hg censor -r $C4 target
291 $ hg cat -r $C4 target
286 $ hg cat -r $C4 target | head -n 10
292 $ hg cat -r "$H2^^" target
287 $ hg cat -r "$H2^^" target | head -n 10
293 Tainted file now super sanitized
288 Tainted file now super sanitized
294 $ echo 'fresh start' > target
289 $ echo 'fresh start' > target
295 $ hg add target
290 $ hg add target
296 $ hg ci -m reincarnated target
291 $ hg ci -m reincarnated target
297 $ H2=`hg id --debug -i`
292 $ H2=`hg id --debug -i`
298 $ hg cat -r $H2 target
293 $ hg cat -r $H2 target | head -n 10
299 fresh start
294 fresh start
300 $ hg cat -r "$H2^" target
295 $ hg cat -r "$H2^" target | head -n 10
301 target: no such file in rev 452ec1762369
296 target: no such file in rev 452ec1762369
302 [1]
297 $ hg cat -r $C4 target | head -n 10
303 $ hg cat -r $C4 target
298 $ hg cat -r "$H2^^^" target | head -n 10
304 $ hg cat -r "$H2^^^" target
305 Tainted file now super sanitized
299 Tainted file now super sanitized
306
300
307 Can censor after revlog has expanded to no longer permit inline storage
301 Can censor after revlog has expanded to no longer permit inline storage
@@ -317,8 +311,8 b' Can censor after revlog has expanded to '
317 $ hg ci -m 'cleaned 100k passwords'
311 $ hg ci -m 'cleaned 100k passwords'
318 $ H2=`hg id --debug -i`
312 $ H2=`hg id --debug -i`
319 $ hg censor -r $C5 target
313 $ hg censor -r $C5 target
320 $ hg cat -r $C5 target
314 $ hg cat -r $C5 target | head -n 10
321 $ hg cat -r $H2 target
315 $ hg cat -r $H2 target | head -n 10
322 fresh start
316 fresh start
323
317
324 Repo with censored nodes can be cloned and cloned nodes are censored
318 Repo with censored nodes can be cloned and cloned nodes are censored
@@ -328,13 +322,13 b' Repo with censored nodes can be cloned a'
328 updating to branch default
322 updating to branch default
329 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 $ cd rclone
324 $ cd rclone
331 $ hg cat -r $H1 target
325 $ hg cat -r $H1 target | head -n 10
332 advanced head H1
326 advanced head H1
333 $ hg cat -r $H2~5 target
327 $ hg cat -r $H2~5 target | head -n 10
334 Tainted file now super sanitized
328 Tainted file now super sanitized
335 $ hg cat -r $C2 target
329 $ hg cat -r $C2 target | head -n 10
336 $ hg cat -r $C1 target
330 $ hg cat -r $C1 target | head -n 10
337 $ hg cat -r 0 target
331 $ hg cat -r 0 target | head -n 10
338 Initially untainted file
332 Initially untainted file
339 $ hg verify
333 $ hg verify
340 checking changesets
334 checking changesets
@@ -346,7 +340,7 b' Repo with censored nodes can be cloned a'
346 Repo cloned before tainted content introduced can pull censored nodes
340 Repo cloned before tainted content introduced can pull censored nodes
347
341
348 $ cd ../rpull
342 $ cd ../rpull
349 $ hg cat -r tip target
343 $ hg cat -r tip target | head -n 10
350 Initially untainted file
344 Initially untainted file
351 $ hg verify
345 $ hg verify
352 checking changesets
346 checking changesets
@@ -365,15 +359,15 b' Repo cloned before tainted content intro'
365 (run 'hg heads' to see heads, 'hg merge' to merge)
359 (run 'hg heads' to see heads, 'hg merge' to merge)
366 $ hg update 4
360 $ hg update 4
367 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
368 $ cat target
362 $ cat target | head -n 10
369 Tainted file now super sanitized
363 Tainted file now super sanitized
370 $ hg cat -r $H1 target
364 $ hg cat -r $H1 target | head -n 10
371 advanced head H1
365 advanced head H1
372 $ hg cat -r $H2~5 target
366 $ hg cat -r $H2~5 target | head -n 10
373 Tainted file now super sanitized
367 Tainted file now super sanitized
374 $ hg cat -r $C2 target
368 $ hg cat -r $C2 target | head -n 10
375 $ hg cat -r $C1 target
369 $ hg cat -r $C1 target | head -n 10
376 $ hg cat -r 0 target
370 $ hg cat -r 0 target | head -n 10
377 Initially untainted file
371 Initially untainted file
378 $ hg verify
372 $ hg verify
379 checking changesets
373 checking changesets
@@ -393,11 +387,11 b' Censored nodes can be pushed if they cen'
393 $ hg ci -m 're-sanitized' target
387 $ hg ci -m 're-sanitized' target
394 $ H2=`hg id --debug -i`
388 $ H2=`hg id --debug -i`
395 $ CLEANREV=$H2
389 $ CLEANREV=$H2
396 $ hg cat -r $REV target
390 $ hg cat -r $REV target | head -n 10
397 Passwords: hunter2hunter2
391 Passwords: hunter2hunter2
398 $ hg censor -r $REV target
392 $ hg censor -r $REV target
399 $ hg cat -r $REV target
393 $ hg cat -r $REV target | head -n 10
400 $ hg cat -r $CLEANREV target
394 $ hg cat -r $CLEANREV target | head -n 10
401 Re-sanitized; nothing to see here
395 Re-sanitized; nothing to see here
402 $ hg push -f -r $H2
396 $ hg push -f -r $H2
403 pushing to $TESTTMP/r
397 pushing to $TESTTMP/r
@@ -408,12 +402,12 b' Censored nodes can be pushed if they cen'
408 added 2 changesets with 2 changes to 1 files (+1 heads)
402 added 2 changesets with 2 changes to 1 files (+1 heads)
409
403
410 $ cd ../r
404 $ cd ../r
411 $ hg cat -r $REV target
405 $ hg cat -r $REV target | head -n 10
412 $ hg cat -r $CLEANREV target
406 $ hg cat -r $CLEANREV target | head -n 10
413 Re-sanitized; nothing to see here
407 Re-sanitized; nothing to see here
414 $ hg update $CLEANREV
408 $ hg update $CLEANREV
415 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
409 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 $ cat target
410 $ cat target | head -n 10
417 Re-sanitized; nothing to see here
411 Re-sanitized; nothing to see here
418
412
419 Censored nodes can be bundled up and unbundled in another repo
413 Censored nodes can be bundled up and unbundled in another repo
@@ -428,12 +422,12 b' Censored nodes can be bundled up and unb'
428 added 2 changesets with 2 changes to 2 files (+1 heads)
422 added 2 changesets with 2 changes to 2 files (+1 heads)
429 new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
423 new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
430 (run 'hg heads .' to see heads, 'hg merge' to merge)
424 (run 'hg heads .' to see heads, 'hg merge' to merge)
431 $ hg cat -r $REV target
425 $ hg cat -r $REV target | head -n 10
432 $ hg cat -r $CLEANREV target
426 $ hg cat -r $CLEANREV target | head -n 10
433 Re-sanitized; nothing to see here
427 Re-sanitized; nothing to see here
434 $ hg update $CLEANREV
428 $ hg update $CLEANREV
435 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 $ cat target
430 $ cat target | head -n 10
437 Re-sanitized; nothing to see here
431 Re-sanitized; nothing to see here
438 $ hg verify
432 $ hg verify
439 checking changesets
433 checking changesets
@@ -492,7 +486,7 b' Censored nodes can be imported on top of'
492 (run 'hg heads .' to see heads, 'hg merge' to merge)
486 (run 'hg heads .' to see heads, 'hg merge' to merge)
493 $ hg update $H2
487 $ hg update $H2
494 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
495 $ cat target
489 $ cat target | head -n 10
496 Re-sanitized; nothing to see here
490 Re-sanitized; nothing to see here
497 $ hg verify
491 $ hg verify
498 checking changesets
492 checking changesets
@@ -516,4 +510,4 b' Can import bundle where first revision o'
516 added 1 changesets with 2 changes to 2 files
510 added 1 changesets with 2 changes to 2 files
517 new changesets e97f55b2665a (1 drafts)
511 new changesets e97f55b2665a (1 drafts)
518 (run 'hg update' to get a working copy)
512 (run 'hg update' to get a working copy)
519 $ hg cat -r 0 target
513 $ hg cat -r 0 target | head -n 10
General Comments 0
You need to be logged in to leave comments. Login now