Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Svn revert all properties changes

Tags:

svn

I have a svn working copy which I attempted to reverse merge a couple of recent revisions into. I cancelled the merge before it completed as I changed my mind. Now my working copy has a couple of thousand "changes" from updates to the ancestry related properties on most of the files. I have about 10 files with real code changes mixed in which I don't want to have to seperate out by hand.

Is there a way for me to revert all of the property changes without affecting the content changes?

like image 344
mchr Avatar asked Jun 21 '10 16:06

mchr


People also ask

How do I revert changes in svn?

Right click on the selected revision(s), then select Context Menu → Revert changes from this revision. Or if you want to make an earlier revision the new HEAD revision, right click on the selected revision, then select Context Menu → Revert to this revision.

What is svn Revert command?

Reverts any local changes to a file or directory and resolves any conflicted states. svn revert will not only revert the contents of an item in your working copy, but also any property changes.


2 Answers

svn revert `svn status | grep '^ M' | sed 's/^ M \+//g'` 
like image 200
Jerome Jaglale Avatar answered Sep 18 '22 15:09

Jerome Jaglale


If you use the revert option --depth empty, you'll revert changes only to paths explicitly specified on the command line and not recursively. So if those changes are property changes, that will be the only thing you revert.

Example: if you have the directory foo with unwanted property changes, but its content has modifications, the following will revert the property changes, but keep the modifications of its content:

$ svn revert --depth empty foo 

as is demonstrated here:

$ svn status foo  M      foo M       foo/bar $ svn revert --depth empty foo $ svn status foo M       foo/bar 
like image 25
TheJuice Avatar answered Sep 18 '22 15:09

TheJuice