[darcs-users] adding then removing a directory doesn't remove subdirs

David Roundy droundy at abridgegame.org
Sat Apr 24 14:49:45 UTC 2004


On Sat, Apr 24, 2004 at 10:23:42AM -0400, Andrew Pimlott wrote:
> I just started using darcs and this is the first "funny" thing I've
> noticed (well, after darcs went wild on a symlink loop, but that was
> already reported).  I'm still getting a feel for the patch system, so I
> hope this will help clarify my understanding.
> 
> When I recursively add a directory tree, then remove it, it seems that
> the files in the tree are forgotten, but the directories aren't.
> 
>     /darcs% darcs inittree
>     Successfully initialized tree!
>     /darcs% mkdir a
>     /darcs% mkdir a/b
>     /darcs% echo hello > a/b/c
>     /darcs% darcs add -r a
>     /darcs% darcs remove a

What version of darcs are you using?

At this point I get a failure message:

% darcs remove a

darcs failed:  Can't remove a

which makes sense, since a isn't empty (and remove doesn't act
recursively).  It could be that this failure message was added recently (I
don't remember)... I do remember that I relatively recently fixed a bug
relating to removal of directories.

>     /darcs% darcs record -a
>     What is the patch name? initial revision
>     Do you want to add a long comment? [yn] n
>     There is no test.
>     Finished recording patch 'initial revision'
>
>     /darcs% darcs get --repo-name ../darcs2 .
>     Finished getting.
>     /darcs% cd ../darcs2
>     /darcs2% find a
>     a
>     a/b
>
> Why is a/b still there?  Should not the remove a have undone that add,
> as it undid the add of a/b/c?

I think this is a fixed bug.  I *think* it's fixed in 0.9.19 (but haven't
tested it yet... I run "latest" darcs on my home machine, for obvious
reasons).
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list