[darcs-users] how to produce conflicts in pending

David Roundy droundy at abridgegame.org
Sun Nov 30 18:15:46 UTC 2003

On Sun, Nov 30, 2003 at 12:15:27PM +1100, Peter Maxwell wrote:
> Moving a file before adding its new directory:
> #!/bin/sh
> T=`TMPDIR=$PWD mktemp -d`
> echo $T
> cd $T
> set -e
> darcs inittree
> echo text > afile.txt
> darcs add afile.txt
> darcs record --all --no-test --patch-name init
> mkdir d
> darcs mv afile.txt d/afile.txt
> darcs add d

Thanks for the report! The problem is that darcs should have failed on the
mv command, since the directory d hadn't been added to the repo.  I've
added a check for this.

A more proper fix would be to *always* check that pending is valid before
writing it (in write_pending, perhaps).  I'm afraid, though, that this
could be slow, may be redundant, and would modify too many files (and thus
might be destabilizing).  This is something that perhaps can be cleaned up
after 1.0.
David Roundy

More information about the darcs-users mailing list