tags:

views:

43

answers:

3

Is there a simple way to accept the working copy “as is” in Subversion? I would like to have the “unknown” files denoted by ? to be added, missing files to be deleted and changed files commited.

+2  A: 

a svn commit would commit the modified files, but for:

  • the deleted files, you need first (before the commit) a command like
    $ svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %
  • the files added (with spaces in them):
   $ svn status | grep "^\?" | sed -e 's/? *//' | sed -e 's/ /\\ /g' | xargs svn add

On recent SVN you could just svn add --force * (it is recursive)

VonC
+1  A: 

There isn't a single svn command that does all that at once.

Here is a simple bash script that deletes missing files:

for i in `svn list -R`; do if [ ! -e $i ]; then svn rm $i; fi; done
amarillion
+1  A: 

If your on windows use TortiseSVN it will show you a list of all the new/deleted files and you can just select all the changes and commit.

HaxElit
Thank you for the tip, but I need to script that.
zoul