views:

769

answers:

3

I want to delete a directory in the repository via command line. At the same time, I don't want to propagate Subversion this change to the local working copy. The directory in the working copy should be remained untouched as it is (alas, I want to set svn:ignore property). Anyway, I couldn't figure out a way to accomplish this without the deletes being propagated to my working copy.

+1  A: 

As far as I know, this is impossible. svn:ignore won't do anything once files are actually being versioned.

It makes something like this somewhat dangerous to do, as people might have local changes they want to keep. If they're not paying attention, they could lose them.

Thorarin
It is not dangerous. Subversion never throws away local modifications without warning. If an update deletes a locally modified folder, then you should get a tree conflict.
Wim Coenen
That's what I thought, until I didn't. I'm not saying it will definitely mess up, but be careful. Just two days ago TortoiseSVN 'disappeared' a newly added file that was not yet committed, just because I svn moved the directory.
Thorarin
+1  A: 

Like Thorarin said, it doesn't seem possible, since the delete command would get propagated regardless of the svn:ignore property.

Instead of deleting, a safer migration might be to rename the problematic directory (to something like dir.old, and then add svn:ignore on the original directory name. You could then tell people to manually copy their directory back to the original name, before you completely delete it.

Depending on the kind of files in this directory, you might also want to keep it around permanently, as a place for developers to synchronize their changes. In this case you can make it clear that it is a template directory by calling it something like dir.tmpl, so that it does not get used directly.

Avi
A: 

Here a stolen answer to another question (thanks Maciej Łebkowski!):

From my experience: don`t put that file under version control and use svn:ignore on it.

It’s a little hard at the beginning, since you cannot ignore a file that is allready under version control, and you cannot remove a file from version control without removing it from hard drive (and from every working copy on next update...). But when you finally manage to set up the repo correctly, it works like charm. Don’t forget to add a generic-template in place of your original config file (so that everyone knows about new config variables, and so on).

For new repo:

mkdir config
svn add config
svn propset svn:ignore '*.conf' config

For existing repo: be sure, to have a backup of your config in every working copy, then remove (svn del) config from the repo, commit (please note: the file will be deleted in every working copy on next update! you have to have a backup) and then restore the file and set the ignore property.

Another way is a lock. It guarantees that noone commits the file, but it will result in an error on every commit. not very nice.

And the third way - changesets, a new feature in SVN 1.5 clients. This is neat, but it’s only related to one working copy, not to a repository globally. And you have to set them up manually, add every new file — it’s hard to maintain.

prinzdezibel