diff -r 622f00b350be -r db121ddd171e tests/test-censor.t --- a/tests/test-censor.t Fri Dec 01 22:44:33 2023 +0100 +++ b/tests/test-censor.t Fri Dec 01 22:46:46 2023 +0100 @@ -79,6 +79,8 @@ $ mkdir -p foo/bar/baz $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target checking for the censored content in 2 heads + checking for the censored content in the working directory + censoring 1 file revision $ hg cat -r $H1 target | head -n 10 Tainted file is now sanitized $ hg cat -r $H2 target | head -n 10 @@ -98,6 +100,8 @@ $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C1 path:target checking for the censored content in 2 heads + checking for the censored content in the working directory + censoring 1 file revision $ hg cat -r $H1 target | head -n 10 Tainted file is now sanitized $ hg cat -r $H2 target | head -n 10 @@ -238,6 +242,8 @@ $ H1=`hg id --debug -i` $ hg --config extensions.censor= censor -r $C3 target checking for the censored content in 2 heads + checking for the censored content in the working directory + censoring 1 file revision $ hg update -r $H2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge -r $C3 @@ -272,6 +278,7 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --config extensions.censor= censor -r . target checking for the censored content in 2 heads + checking for the censored content in the working directory abort: cannot censor working directory (clean/delete/update first) [255] @@ -286,6 +293,8 @@ $ H2=`hg id --debug -i` $ hg --config extensions.censor= censor -r $C4 target checking for the censored content in 2 heads + checking for the censored content in the working directory + censoring 1 file revision $ hg cat -r $C4 target | head -n 10 $ hg cat -r "$H2^^" target | head -n 10 Tainted file now super sanitized @@ -319,6 +328,8 @@ 10 ?????? no file target (glob) $ hg --config extensions.censor= censor -r $C5 target checking for the censored content in 2 heads + checking for the censored content in the working directory + censoring 1 file revision The important part is for the censor operation to not crash and the repository to not be corrupted. Right now this involve keeping the revlog split. @@ -398,6 +409,8 @@ Passwords: hunter2hunter2 $ hg --config extensions.censor= censor -r $REV target checking for the censored content in 3 heads + checking for the censored content in the working directory + censoring 1 file revision $ hg cat -r $REV target | head -n 10 $ hg cat -r $CLEANREV target | head -n 10 Re-sanitized; nothing to see here @@ -499,6 +512,8 @@ $ hg init ../rinit $ hg --config extensions.censor= censor -r 0 target checking for the censored content in 3 heads + checking for the censored content in the working directory + censoring 1 file revision $ hg bundle -r 0 --base null ../rinit/initbundle 1 changesets found $ cd ../rinit @@ -514,6 +529,8 @@ Can skip the head checking steps $ hg --config extensions.censor= censor -r 0 --no-check-heads target + checking for the censored content in the working directory + censoring 1 file revision #if revlogv2 @@ -554,6 +571,8 @@ *50002 (re) $ hg --config extensions.censor= censor -r $B1 target checking for the censored content in 1 heads + checking for the censored content in the working directory + censoring 1 file revision $ hg cat -r $B1 target | wc -l *0 (re)