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?
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.
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.
svn revert `svn status | grep '^ M' | sed 's/^ M \+//g'`
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
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