tags:

views:

40

answers:

2

How can I remove files&directories (from my localcopy) that have been already removed from svn repository (server) by somebody else?

I'd like to keep my changes (and added files) untouched. And by "my changes" I mean that I have added some new files but their are not yet under svn (their have the "?" status).

After performing "svn update" and "svn stat" I get a list of files that prefixed with "?" - those files are my changes mixed with deleted files.

Is there any way to remove those "deleted" files? It would be nice to delete them only if they are not modified by me.

+1  A: 

Add your modified files to svn

then list all the statuses, find all that have "?" state and delete them.

svn status | grep ^? | xargs rm -v

The trick is getting all your new files under version control, deleting the "deleted files" is then easy.

hhafez
Yes, but is there any way to find out whitch files were added by me and whitch are "?" because they were removed? Is there any information in the magic ".svn" directory that would help me?It looks like I made a big mistake not "svn add"-ing my files before updating.
Chris
well atleast half your problem can be automated, once you add your files the rest is easy, or vice versa once you delete the deleted files manually adding the rest is easy, you don't need to do both manually
hhafez
A: 

I recommend not trying to come up with a scripting solution here; the safest thing to do is inspect each file and determine if it needs to be kept or not.

And you should be able to tell which files are new and which were previously in the repository just by looking at prior revisions and seeing if the file exists.

Michael Hackner