Proof:
ben@home[1]:.../scratch/screened>darcs repair
The repository is already consistent, no changes made.
ben@home[1]:.../scratch/screened>darcs optimize clean
Done cleaning repository!
ben@home[1]:.../scratch/screened>ls _darcs/inventories
0003430672-f563282c907e0da58cd9c162e7a5c28785ee3f2e0010489f002d83d1eab60f4c
I discovered this by reading the code. Indeed after reading the current
PatchSet, we convert it to an FL, run the repair operation, then convert to
a PatchSet NilRL (patches').
This is bad because it makes certain operations behind the latest clean tag
quite inefficient, such as cloning any earlier tag.
There are two solutions:
We can break up the algorithm, traversing the Tagged sections one by one,
reconstructing a PatchSet with the same overall structure as the one we
started out with.
Or we can re-construct a new inventory structure by creating a Tagged
section whenever we hit a clean tag. This is a bit easier to do since I
recently added that functionality for another reason (not yet published).
|