[darcs-users] recording complex changes

David Roundy droundy at abridgegame.org
Sat Nov 29 15:38:34 UTC 2003

On Sat, Nov 29, 2003 at 11:39:16PM +1100, Peter Maxwell wrote:
> Strange things happen when I try to do a moderately large rearrangement 
> of my source tree (new directories, several files changed and/or moved) 
> with one 'darcs record'.  The workaround seems to be to break it up 
> into smaller steps, but that means using --no-test and recording 
> intermediate non-functioning versions.  Here's a test case:
> #!/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 add d
> mkdir d/e
> darcs add d/e
> darcs mv afile.txt d/e/afile.txt
> echo altered_text > d/e/afile.txt
> darcs record --all --no-test --patch-name confusion
> echo
> diff -q ./ ./_darcs/current/ | grep -v '_darcs$' | grep -v '^Common'
> echo
> yes | darcs unrecord

Fixed.  (and this test case was added to the test suite)

Thanks for the report.  What's happening here was that the ordering of the
operations on current is getting confused.  Darcs was creating the
directory after moving the file (so the file mv failed and you ended up
with two copies).  This was due to very old code in SlurpDirectory, which
was very ugly--the bugfix replaces 19 lines of code with three lines.

> I've also encountered "Yikes, pending has conflicts!" while doing this 
> sort of thing, but I haven't come up with a reproducible test case yet. 
>  If you end up unable to unrecord ("Unable to apply inverse patch!") 
> and unable to record ("Yikes, pending has conflicts!") at the same time 
> you can't go forwards or back!

Well, if you do come up with a reproducible test case, that would be great.
In the meantime, if you get stuck like this, you can get out of it by doing
a darcs get, or perhaps by deleting (or renaming) _darcs/patches/pending.
Or with the latest darcs, you could try a darcs repair on a copy of the
repo--it may not work, but I'd be interested in hearing the results.
David Roundy

More information about the darcs-users mailing list