[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Cannot delete directory after deleting included file

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Mon, 9 Aug 2010 23:40:25 +0200

On Sun, Aug 8, 2010 at 9:58 PM, Richard Biffl
<subversion-user-ml_at_blacklettersoftware.com> wrote:
> If I delete a file from a directory in my working copy, and commit the deletion,
> and then delete the directory that held the deleted file, I cannot commit the
> working copy. I get a message instead that the directory is out of date.
> At that point, I cannot revert the directory deletion, and if I try to update
> the working copy, I am told I have a tree conflict.
> The way to prevent this problem, I've learned, is to update the working copy
> after I commit the deletion of the single file. But that's not intuitive,
> especially when I am the only user and I'm making changes from just one working
> copy. It seems wrong that I should need to update immediately after I commit.
> Here is a list of commands that shows the problem. It's in Windows cmd:
> [starting with empty repository \svn\repo1]
> $ mkdir work1
> $ svn checkout file:///svn/repo1 work1
> $ mkdir work1\dir1
> $ echo blah > work1\dir1\file1
> $ echo blah > work1\dir1\file2
> $ svn add work1\dir1
> $ svn commit work1 -m "Created directory with 2 files."
> $ svn delete work1\dir1\file1
> $ svn commit work1 -m "Deleted dir1\file1."
> $ svn delete \work1\dir1
> $ svn commit work1 -m "Deleted dir1 and dir1\file2."
> Deleting        \work1\dir1
> svn: Commit failed (details follow):
> svn: Directory '/dir1' is out of date

This looks similar to issue 3526:
http://subversion.tigris.org/issues/show_bug.cgi?id=3526 - Commit of
newly added file followed by move (or delete) of parent dir causes
tree conflict

A couple of relevant discussions which may provide some additional insight:
- http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2388307
- http://svn.haxx.se/dev/archive-2010-03/0496.shtml
- http://svn.haxx.se/users/archive-2010-06/0033.shtml

I'm not sure what the current plan is for that issue. As far as I
understand, the out-of-dateness can not be avoided. It is a
consequence of the "mixed-revision working copy" system that SVN uses.

I think it would already help a lot of there would be no tree conflict
when updating (which is what issue 3526 is actually about). But I'm
not sure if someone is actively working on this.

From one of the mail threads above, a good workaround to avoid this
issue is to always update a directory before you move or delete it
(you don't have to update the entire working copy, just the part you
are about to move/delete).

Received on 2010-08-09 23:41:03 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.