Fossil SCM
checkin/9fd948ff0ff06ac6450ccff7444565ee391710250f28388ef032ebb00c593f4d
fossil scrub --private and the purge graveyard
fossil scrub exists so that a repository can be sent to an untrusted
reader. With --private it removed private content from the repository but
left the purge graveyard alone, although the graveyard records which of its
items were private. A private branch purged before the scrub survived it:
fossil purge cat could read it and fossil purge undo could bring it back.
A clone never carries the graveyard; sending the repository file does.
Now --private also removes from the graveyard every item that was private
when it was purged, and any purge event left empty. A kept item stored as a
delta from a removed one is stored whole first, so it can still be read.
--verily already removed the whole graveyard.
Not changed: when private content is removed, scrub rebuilds rather than
vacuums, so deleted data can remain in free pages of the file until it is
vacuumed, for example with fossil rebuild --vacuum. That is read from the
code, not shown.
Tested with ASan and UBSan on macOS and Linux (x86-64) by a new
test/purge.test: after scrub --private the graveyard holds no private
item, purge cat cannot read one, and a public item that was a delta of a
private one can still be read. The test file will come with the test-suite
work. Not run on Windows.