Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you revert ONLY directories in an SVN working copy?

I want to revert a directory and all sub-directories in an SVN working copy so they match the repository but I don't want to touch any files inside those directories.

One of my SVN applications recursively set an SVN property on every directory in my working copy but I want to revert those changes to stop it highlighting them and trying to commit the changes to the SVN properties. Simply changing it to match the HEAD doesn't work.

Any ideas? I've read through various SVN resources but none of them seem to deal with this edge case.

like image 538
Rushyo Avatar asked Jan 27 '11 15:01

Rushyo


2 Answers

Works on all platforms:

svn revert . --recursive

(Note that this will revert everything, not just directories.)

like image 192
ian Avatar answered Oct 20 '22 13:10

ian


You could use find combined with svn revert:

find . -type d | grep -v .svn | xargs svn revert

This won't touch any files inside the directories unless you use the -Roption (which is equivalent of --depth=infinity).

like image 9
Eugene Yarmash Avatar answered Oct 20 '22 14:10

Eugene Yarmash