Every repository with this icon (
Every repository with this icon (
Home
Status
undarcs can now export the first 1500 patches from a 3000 patch Darcs version 1 repo at work.
It currently gets stuck attempting to apply a patch to a non-existing file. (A ‘workaround’ has been submitted
to the darcs-fast-export repo).
Update undarcs can now export all of the patches from my test repo – except the resultant file content is different. There
is still something missing from my understanding of Darcs’s patch representation. I will no longer be spending any time on
this project. Hopefully it may be useful to somebody.
Darcs Patches
Essentially darcs’s inventory is a sequence of patch identifiers. The identifiers can be used to find the corresponding patch (.gz) file. When the patches are applied in order from the beginning to the end of the inventory against an initially empty tree, you should get a tree that looks like Darcs’s pristine. That’s the theory at least.
Darcs patches consist of a header (exactly the same format as an entry in the inventory file) followed by a sequence of commands (a.k.a. ‘primitive patches’ in Darcs parlance).
The commands are things such as ‘addfile’, ‘adddir’ ‘rmfile’, ‘rmdir’ ‘hunk’ etc. By parsing the commands and executing them in the order they
appear in the patch, you get a working tree. There are a few idiosyncrasies: there are such things as ‘compound patches’ which group collections of commands together between curly braces. I’m not sure what the significance of those are, but flattening the nesting and simply processing the commands seems to produce valid output.
Also, there are ‘merger’ sections, which capture the intricate details of how patches conflict with each other. Good news: we can ignore those. undarcs just rides straight on past those. They conflict that is caused is resolved in a subsequent patch in the regular command-oriented way.






