[darcs-users] Re: [darcs #473] "delete": It should do what you think it means

David Roundy droundy at darcs.net
Sat Aug 6 11:59:01 UTC 2005


On Fri, Aug 05, 2005 at 03:46:21PM +0200, 17e782802 at sneakemail.com wrote:
> Problem: The unpull command is bad. It deletes patches which are thought
> to be safe. A version control system must not do this!

We don't actually delete the patch file on unpull, but a patch file without
context can't be applied automatically.  So already a darcs guru could go
in and reverse the unpull by looking at the contents _darcs/patches/, but
requires additional knowledge to reproduce the context.

> Therefore I propose the following solution: For each working directory
> keep a set (in a mathematical sense) of which patches must be applied to
> an empty repository so that the pristine tree can be reconstructed. Not
> all patches from the _darcs/patches directory need to be in that file.

The trick is that we need to know the "order" of the patches, so it's not
just a set.  It's equivalent to a set in that the order doesn't matter, but
the order affects the meaning of the patches themselves.

Much of what you describe is how darcs already works, but reordering
patches can be an expensive operation (and the context of a patch can
consume a large amount of space, so we'd rather not store it in the patch
itself), so there are tradeoffs that we need to work with to make darcs
efficient.

> Bonus: If having more than one repository on a disk the _darcs/patches
> directory can be symlinked as a whole, therefore saving disk space.
> Therefore the cost of branching is significantly reduced.

We support hard linking already (see darcs optimize --relink), which is
better, since you won't mess up one repository by deleting another.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-users mailing list