I work in a team of developers and we don't have exactly separated code. So when I work on something for about a week, I need to do an update before i commit my changes. But when I do so, then all deleted files are restored. I know there is SVN delete operation, but it is annoying to do it for every deleted file or directory.
Is there any trick, how prevent this feature?
So, this is not basically a new answer but none of the existing seemed to fit to your exact question (and the problem I experience often).
Here is my approach: If you deleted files and don't want them to get restored during the neccesary update:
Of course this is "SVN delete", but this way you won't have to do it at the time you actually delete the files and are able to mark all of them in a batch.
There are two kinds of deletes here.
rm
or delete
).svn delete
).Make sure you know which kind you are doing. If you are deleting from the file system (local machine) only, then when you ask to update to the latest in your repository, you should get the file back.
If you are deleting from revision control, then it is a svn change operation, and will not apply to the repository until you run svn commit
. After that as others update, svn will remove the file from their repositories.
Note that this does not mean that it is impossible to get a copy of the file. SVN keeps a full history of every revision, so if you request the non-current revisions that have a copy of the file, you will get a copy of the svn delete
d file as it was in that revision.
In the rare case you really want the file gone from the historical records too, you need to do some scripting. Basically, you will be creating a new repository which mimics the old one (minus the file). To do this
For each revision number from 1 to current.
Keep in mind that this can be a bit difficult to do well, as you will need to come up with solutions to preserve the meta-data, like file permissions, commit messages, svn properties, commit times, and commit user names.
I highly recommend against rebuilding your history this way, unless there is some globally overriding reason to do so, like a court order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With