Show More
@@ -129,6 +129,8 b" def _docensor(ui, repo, path, rev=b'', t" | |||
|
129 | 129 | hint=_(b'clean/delete and commit first'), |
|
130 | 130 | ) |
|
131 | 131 | |
|
132 | msg = b'checking for the censored content in the working directory\n' | |
|
133 | ui.status(msg) | |
|
132 | 134 | wp = wctx.parents() |
|
133 | 135 | if ctx.node() in [p.node() for p in wp]: |
|
134 | 136 | raise error.Abort( |
@@ -136,5 +138,7 b" def _docensor(ui, repo, path, rev=b'', t" | |||
|
136 | 138 | hint=_(b'clean/delete/update first'), |
|
137 | 139 | ) |
|
138 | 140 | |
|
141 | msg = b'censoring 1 file revision\n' | |
|
142 | ui.status(msg) | |
|
139 | 143 | with repo.transaction(b'censor') as tr: |
|
140 | 144 | flog.censorrevision(tr, fnode, tombstone=tombstone) |
@@ -79,6 +79,8 b' Censor revision with 2 offenses' | |||
|
79 | 79 | $ mkdir -p foo/bar/baz |
|
80 | 80 | $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target |
|
81 | 81 | checking for the censored content in 2 heads |
|
82 | checking for the censored content in the working directory | |
|
83 | censoring 1 file revision | |
|
82 | 84 | $ hg cat -r $H1 target | head -n 10 |
|
83 | 85 | Tainted file is now sanitized |
|
84 | 86 | $ hg cat -r $H2 target | head -n 10 |
@@ -98,6 +100,8 b' Censor revision with 1 offense' | |||
|
98 | 100 | |
|
99 | 101 | $ hg --config extensions.censor= --cwd foo/bar/baz censor -r $C1 path:target |
|
100 | 102 | checking for the censored content in 2 heads |
|
103 | checking for the censored content in the working directory | |
|
104 | censoring 1 file revision | |
|
101 | 105 | $ hg cat -r $H1 target | head -n 10 |
|
102 | 106 | Tainted file is now sanitized |
|
103 | 107 | $ hg cat -r $H2 target | head -n 10 |
@@ -238,6 +242,8 b" with the file censored, but we can't cen" | |||
|
238 | 242 | $ H1=`hg id --debug -i` |
|
239 | 243 | $ hg --config extensions.censor= censor -r $C3 target |
|
240 | 244 | checking for the censored content in 2 heads |
|
245 | checking for the censored content in the working directory | |
|
246 | censoring 1 file revision | |
|
241 | 247 | $ hg update -r $H2 |
|
242 | 248 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
243 | 249 | $ hg merge -r $C3 |
@@ -272,6 +278,7 b' Cannot censor working directory' | |||
|
272 | 278 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
273 | 279 | $ hg --config extensions.censor= censor -r . target |
|
274 | 280 | checking for the censored content in 2 heads |
|
281 | checking for the censored content in the working directory | |
|
275 | 282 | abort: cannot censor working directory |
|
276 | 283 | (clean/delete/update first) |
|
277 | 284 | [255] |
@@ -286,6 +293,8 b' Can re-add file after being deleted + ce' | |||
|
286 | 293 | $ H2=`hg id --debug -i` |
|
287 | 294 | $ hg --config extensions.censor= censor -r $C4 target |
|
288 | 295 | checking for the censored content in 2 heads |
|
296 | checking for the censored content in the working directory | |
|
297 | censoring 1 file revision | |
|
289 | 298 | $ hg cat -r $C4 target | head -n 10 |
|
290 | 299 | $ hg cat -r "$H2^^" target | head -n 10 |
|
291 | 300 | Tainted file now super sanitized |
@@ -319,6 +328,8 b' Can censor enough revision to move back ' | |||
|
319 | 328 | 10 ?????? no file target (glob) |
|
320 | 329 | $ hg --config extensions.censor= censor -r $C5 target |
|
321 | 330 | checking for the censored content in 2 heads |
|
331 | checking for the censored content in the working directory | |
|
332 | censoring 1 file revision | |
|
322 | 333 | |
|
323 | 334 | The important part is for the censor operation to not crash and the repository |
|
324 | 335 | to not be corrupted. Right now this involve keeping the revlog split. |
@@ -398,6 +409,8 b' Censored nodes can be pushed if they cen' | |||
|
398 | 409 | Passwords: hunter2hunter2 |
|
399 | 410 | $ hg --config extensions.censor= censor -r $REV target |
|
400 | 411 | checking for the censored content in 3 heads |
|
412 | checking for the censored content in the working directory | |
|
413 | censoring 1 file revision | |
|
401 | 414 | $ hg cat -r $REV target | head -n 10 |
|
402 | 415 | $ hg cat -r $CLEANREV target | head -n 10 |
|
403 | 416 | Re-sanitized; nothing to see here |
@@ -499,6 +512,8 b' Can import bundle where first revision o' | |||
|
499 | 512 | $ hg init ../rinit |
|
500 | 513 | $ hg --config extensions.censor= censor -r 0 target |
|
501 | 514 | checking for the censored content in 3 heads |
|
515 | checking for the censored content in the working directory | |
|
516 | censoring 1 file revision | |
|
502 | 517 | $ hg bundle -r 0 --base null ../rinit/initbundle |
|
503 | 518 | 1 changesets found |
|
504 | 519 | $ cd ../rinit |
@@ -514,6 +529,8 b' Can import bundle where first revision o' | |||
|
514 | 529 | Can skip the head checking steps |
|
515 | 530 | |
|
516 | 531 | $ hg --config extensions.censor= censor -r 0 --no-check-heads target |
|
532 | checking for the censored content in the working directory | |
|
533 | censoring 1 file revision | |
|
517 | 534 | |
|
518 | 535 | #if revlogv2 |
|
519 | 536 | |
@@ -554,6 +571,8 b' Censor the file' | |||
|
554 | 571 | *50002 (re) |
|
555 | 572 | $ hg --config extensions.censor= censor -r $B1 target |
|
556 | 573 | checking for the censored content in 1 heads |
|
574 | checking for the censored content in the working directory | |
|
575 | censoring 1 file revision | |
|
557 | 576 | $ hg cat -r $B1 target | wc -l |
|
558 | 577 | *0 (re) |
|
559 | 578 |
@@ -16,6 +16,8 b'' | |||
|
16 | 16 | $ hg commit -m "erased secret" |
|
17 | 17 | $ hg censor target --config extensions.censor= -r ".^^" |
|
18 | 18 | checking for the censored content in 1 heads |
|
19 | checking for the censored content in the working directory | |
|
20 | censoring 1 file revision | |
|
19 | 21 | $ hg update ".^" |
|
20 | 22 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
21 | 23 | $ cat target |
General Comments 0
You need to be logged in to leave comments.
Login now