New submission from Eric Kow <[EMAIL PROTECTED]>:

I don't know if this is theoretically possible to fix, but it would be really
nice if this case behaved better.

mkdir foo
cd foo
darcs init
mkdir d
darcs add d
darcs record -a -m "Added directory d"
cd ..

darcs get foo puller
cd puller
echo "moo" > d
cd ..

cd foo
rmdir d
darcs record -a -m "Remove directory d"
cd ..

cd puller
darcs pull

darcs failed:  user error (Error applying patch to working dir:
./d: removeDirectory: unsatisified constraints (Directory not empty))
This may have left your working directory an inconsistent
but recoverable state. If you had no un-recorded changes
by using 'darcs revert' you should be able to make your
working directory consistent again.

==========

Some ideas on how things might behave better:
1) before applying a named patch, could darcs check there this constraint is
satisfiable?  if not, it could simply refuse to apply the patch

2) a much smoother behaviour if it it simply removed the directory in the
pristine tree, and leave the one in your working directory untouched.  It should
perhaps display a warning, but otherwise succeed. When you do darcs what -ls,
you should see a directory that needs to be darcs added

The kind of scenario where people's text editors or software dumps temporary
files into a directory which is darcs rm'ed by patch.  If they pull that kind of
patch in, then they get this scary message and have to do lots of gentle nursing
to get darcs back into a consistent state.

(setting to bug because I need a priority, although whether this is actually a
bug is debatable)

----------
messages: 593
nosy: EricKow, droundy, tommy
priority: bug
status: unread
title: removing a non-empty directory is catastrophically painful

____________________________________
Darcs issue tracker <[EMAIL PROTECTED]>
<http://bugs.darcs.net/issue154>
____________________________________

_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to