Svn will return all property changes

I have a working copy of svn that I tried to minimize to merge a couple of recent changes. I canceled the merger until I finished when I changed my mind. Now my working copy contains several thousand “changes” from updates to ancestor-related properties for most files. I have about 10 files with real code changes, mixed, in which I do not want to split them manually.

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

+25
svn
Jun 21 '10 at 16:21
source share
6 answers

It turns out that Tortoise SVN can do it really nicely. In the commit dialog box, you can sort the “modified” files by “text status” or “property status”. I just sorted by text status, and then returned all the “modified” files with the “normal” “text status”.

+9
Jun 22 2018-10-06T00:
source share
svn revert `svn status | grep '^ M' | sed 's/^ M \+//g'` 
+30
Nov 22 2018-11-11T00:
source share

If you use the option '--depth empty', you can undo changes only for paths explicitly specified on the command line, so if you specify all directories that have property changes, but NONE from the files whose contents you want to save .

eg. if you have a directory "foo" with unwanted property changes, but the file "bar" inside "foo", the following should save the mods in "bar", but return the property changes to "foo".

 $svn revert --depth empty foo 
+16
Jun 21 '10 at 16:29
source share

You can submit your changes and then revert property changes from this version:

svn merge -c -REV -depth empty

where REV is the version in which you want to return property changes

0
Jul 29 '15 at 22:49
source share

Undo all property changes using PowerShell.

 > @(svn status) -match '^ M' | ` >>> % { ($_ -split 'M\s+')[1] } | ` >>> % { svn revert --depth empty $_ } 

Credit Jerome Jaglaya and TheJuice for a general approach.

Note that the backtick ` character indicates a new line.

0
Sep 30 '15 at
source share

I would just copy / archive 10 files with a real code change elsewhere and just svn revert -R whole project, and then copy 10 files.

-3
Jun 21 '10 at 16:26
source share



All Articles