##// END OF EJS Templates
censor: fix things around inlining...
marmoute -
r52052:3e2a878f stable
parent child Browse files
Show More
@@ -72,11 +72,16 b' def v1_censor(rl, tr, censornode, tombst'
72 72 radix=rl.radix,
73 73 postfix=b'tmpcensored',
74 74 censorable=True,
75 data_config=rl.data_config,
76 delta_config=rl.delta_config,
77 feature_config=rl.feature_config,
78 may_inline=rl._inline,
75 79 )
76 newrl._format_version = rl._format_version
77 newrl._format_flags = rl._format_flags
78 newrl.delta_config.general_delta = rl.delta_config.general_delta
79 newrl._parse_index = rl._parse_index
80 # inline splitting will prepare some transaction work that will get
81 # confused by the final file move. So if there is a risk of not being
82 # inline at the end, we prevent the new revlog to be inline in the first
83 # place.
84 assert not (newrl._inline and not rl._inline)
80 85
81 86 for rev in rl.revs():
82 87 node = rl.node(rev)
@@ -122,7 +127,10 b' def v1_censor(rl, tr, censornode, tombst'
122 127 tr.addbackup(rl._datafile, location=b'store')
123 128
124 129 rl.opener.rename(newrl._indexfile, rl._indexfile)
125 if not rl._inline:
130 if newrl._inline:
131 assert rl._inline
132 else:
133 assert not rl._inline
126 134 rl.opener.rename(newrl._datafile, rl._datafile)
127 135
128 136 rl.clearcaches()
@@ -298,12 +298,9 b' Can censor enough revision to move back '
298 298
299 299 $ hg debugrevlogstats | grep target
300 300 rev-count data-size inl type target
301 8 ????????? no file target (glob) (revlogv2 !)
302 8 ????????? yes file target (glob) (revlogv1 !)
303 $ for x in `"$PYTHON" $TESTDIR/seq.py 0 50000`
304 > do
305 > echo "Password: hunter$x" >> target
306 > done
301 8 ??? no file target (glob) (revlogv2 !)
302 8 ??? yes file target (glob) (revlogv1 !)
303 $ cat /dev/rand?m | dd status=none count=200 | f --hexdump > target
307 304 $ hg ci -m 'add 100k passwords'
308 305 $ H2=`hg id --debug -i`
309 306 $ C5=$H2
@@ -312,17 +309,25 b' Can censor enough revision to move back '
312 309 $ H2=`hg id --debug -i`
313 310 $ hg debugrevlogstats | grep target
314 311 rev-count data-size inl type target
315 10 ????????? no file target (glob) (revlogv2 !)
316 10 ????????? no file target (glob) (missing-correct-output revlogv1 !)
317 10 ????????? yes file target (glob) (known-bad-output revlogv1 !)
312 10 ?????? no file target (glob)
318 313 $ hg --config extensions.censor= censor -r $C5 target
314
315 The important part is for the censor operation to not crash and the repository
316 to not be corrupted. Right now this involve keeping the revlog split.
317
319 318 $ hg debugrevlogstats | grep target
320 319 rev-count data-size inl type target
321 10 ????????? no file target (glob) (revlogv2 !)
322 10 ????????? yes file target (glob) (revlogv1 !)
320 10 ??? no file target (glob)
323 321 $ hg cat -r $C5 target | head -n 10
324 322 $ hg cat -r $H2 target | head -n 10
325 323 fresh start
324 $ hg verify
325 checking changesets
326 checking manifests
327 crosschecking files in changesets and manifests
328 checking files
329 checking dirstate
330 checked 12 changesets with 13 changes to 2 files
326 331
327 332 Repo with censored nodes can be cloned and cloned nodes are censored
328 333
@@ -354,7 +359,7 b' Repo cloned before tainted content intro'
354 359 adding manifests
355 360 adding file changes
356 361 added 11 changesets with 11 changes to 2 files (+1 heads)
357 new changesets 186fb27560c3:683e4645fded
362 new changesets * (glob)
358 363 (run 'hg heads' to see heads, 'hg merge' to merge)
359 364 $ hg update 4
360 365 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -414,7 +419,7 b' Censored nodes can be bundled up and unb'
414 419 adding manifests
415 420 adding file changes
416 421 added 2 changesets with 2 changes to 2 files (+1 heads)
417 new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
422 new changesets * (glob)
418 423 (run 'hg heads .' to see heads, 'hg merge' to merge)
419 424 $ hg cat -r $REV target | head -n 10
420 425 $ hg cat -r $CLEANREV target | head -n 10
@@ -471,7 +476,7 b' Censored nodes can be imported on top of'
471 476 adding manifests
472 477 adding file changes
473 478 added 6 changesets with 5 changes to 2 files (+1 heads)
474 new changesets efbe78065929:683e4645fded (6 drafts)
479 new changesets * (glob)
475 480 (run 'hg heads .' to see heads, 'hg merge' to merge)
476 481 $ hg update $H2
477 482 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now