[darcs-users] Problems removing a removed file

David Roundy droundy at jdj5.mit.edu
Thu May 1 21:06:35 UTC 2003


On Thu, May 01, 2003 at 08:56:56PM +0100, Philip Martin wrote:
> 

...

> If I uncomment the 'rm foo' line the pull works, but it has a side
> effect of creating fooB/foo which didn't exist prior to the pull.

Thanks for the report! This bug is fixed in the darcs repository.  There
are also a number of not so well-tested changes in there right now, since
I'm working on converting the code over to the new repo format.  I'll try
to stabilize that stuff soon for a new release.

The bug was an interesting one.  The working directory is a nasty place for
darcs to be working, because it can never guess what files might exist
there (which it wouldn't want to overwrite).  This can lead to trouble,
since there is a lot of code that has to deal with the "pure" repository as
well as the "dirty" working directory.  In this case, when darcs sees the
conflict between the two removes of the same file, it recognizes that the
right thing to do is just to remove the file, but it represents this by
re-adding it, then removing it again (which should be equivalent to a noop,
or an identity operation).  This is fine in the _darcs/current directory,
where everything is clean, but causes trouble in the working dir where the
file may not have been removed the first time, in which case the add fails.
The solution, which is a nice general one (and simple, too), is to coalesce
(i.e. simplify) the patch which results from the merge of the conflict.
Probably more than anyone wanted to hear about this bug, but I found it
rather interesting that the fix for it ended up having nothing to do with
adding or removing files!

(Ok, slow computer, the fix actually won't be added to the repo until it
finishes the test suite, which will be a few minutes...)
-- 
David Roundy
http://civet.berkeley.edu/droundy/




More information about the darcs-users mailing list