Issue 2684 darcs repair destroys inventory structure

Title darcs repair destroys inventory structure
Priority bug Status unknown
Milestone Resolved in
Superseder Nosy List bfrk
Assigned To

Created on 2021-10-03.16:13:01 by bfrk, last changed 2021-10-03.16:13:08 by bfrk.

msg22913 (view) Author: bfrk Date: 2021-10-03.16:12:59

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

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).
Date User Action Args
2021-10-03 16:13:01bfrkcreate
2021-10-03 16:13:08bfrksetpriority: bug