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

Deleting an Added Directory

From: Peter Davis <peter_at_pdavis.cx>
Date: 2002-08-10 05:32:01 CEST

This is one of two problems I've discovered (a post on the second is on the
way).

Things work just fine (almost, see my other email) if I just 'svn mkdir foo'
and 'svn rm --force foo'. But what is supposed to happen if I physically
delete 'foo'? I found this problem when I wanted to remove a tree I had not
yet committed, but I wanted to save a copy as backup before actually deleting
the local mods.

Note that this does not apply to directories that have been mkdir'd and then
committed. If the directory is actually in the repository, then an 'svn up'
will restore the deleted tree so I can do 'svn rm' properly.

$ svn mkdir foo
$ mv foo foo.bak # or 'rm -rf foo'
$ svn rm --force foo
subversion/libsvn_subr/io.c:1567: (apr 2, src 0)
svn: No such file or directory
svn: svn_io_file_open: can't open `foo/.svn/lock'

After that, for the life of me I can't get it to fix the various errors that
result without manually editing './.svn/entries'. Either that, or I have to
'mv foo.bak foo; cp -a foo foo.bak; svn rm --force foo'. Of course, I can't
do that if I 'rm -rf foo' in the first place.

The problem might not be so bad if there were some instructions that said,
"Don't delete your .svn directory, and also don't delete any other
directories without doing it through 'svn rm'." But it *is* possible to
delete an added *file* manually, and if you do that then you don't even have
to use --force to 'svn rm'.

So, my suggestion is that 'svn rm' on a deleted added directory should work
just like it does to a deleted added file: it just removes the entry from
'.svn/entries' and goes on with life. The directory is not in the
repository, so there would be nothing to worry about. And it doesn't have
any local mods either, since they have been deleted.

-- 
Peter Davis
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Aug 10 05:32:36 2002

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

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