We should replace _darcs/hashed_inventory with a small file that
contains only the pristine hash and the current inventory hash. Let
me call that file _darcs/head, for reference, the actual name is up
for bikeshedding.
The format of this file should be such that we can add more hashes to
it without breaking compatibility. For instance, a sequence of lines
of the form "keyword:hash" with no spaces, keyword matches [a-z_]+,
hash matches [0-9a-f]+. The internal representation retains /all/
(keyword,hash) pairs in a finite map, and also restores them when
when writing the file; order of lines is irrelevant.
The reason I want this to be extendable is that we can then add
hashes for things like the pending patch, the rebase patch, etc.
The reason I am proposing this solution at all is that it paves the
way for internal branches.
The only question is how to make this change in a compatible way. I
think that requires that we keep maintaining the
_darcs/hashed_inventory file. We also need a way to find out which of
_darcs/hashed_inventory or _darcs/head is the more current one. Can
we just compare the modification timestamps?
|