darcs

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
Topics

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

Messages
msg22913 (view) Author: bfrk Date: 2021-10-03.16:12:59
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).
History
Date User Action Args
2021-10-03 16:13:01bfrkcreate
2021-10-03 16:13:08bfrksetpriority: bug