Svn return from change set

Is there a way to return from a specific set of changes?

Changes were committed, as I see from the set of changes. Now I want to return the files before they are committed.

I did svn returned the path / to / file, but it did not ask for a password or anything else. Nothing happens.

+7
svn
source share
5 answers

Solved: svn merge -r1234: 4321 path / to / yourfile path / to / thefileyouanttogobackto,

Where
1234 is your revision
4321 is the revision you want to return to.

+3
source share

You can perform a “reverse merge”, that is, “apply” all changes from the current version to the revision that you want to revert to (that is, undo all changes from the version you want to revert to to the current version).

svn merge -r HEAD:nnnn . 

where nnnn is the revision you want to return to. http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.merge.html

After viewing the changes, resolving conflicts, etc. use svn commit to make changes to the repository.

+3
source share

If you know the specific revision you want to return, this is another way to return it.

 svn diff -c r1031 | grep ^Index | awk '{ print $2}' | xargs -I {file} svn export -r 1030 {file} {file} 

It finds all files modified in r1031 and replaces them with the same files from version 1030.

PS: Also, please be careful if the files you want to return are missing in 1030. Perhaps this does not work as you expected.

+1
source share

See this blog post for more details:

http://blog.mafr.de/2008/05/13/revert-a-commit-in-svn/

with a good reference explanation:

To understand what is going on here, it takes some idea of ​​what the merge team does conceptually: it records what changes should be made to revision N in order to turn it into revision N + 1 (called delta) and applies it to the working copy. This is not what we want in our script, so we are abolishing the normal line command revision procedure. Effectively, we inform the merger team to create a delta detour. The result is a "rewind" of the code base.

And also in the comments how to do it in TortoiseSVN:

To do this with TortoiseSVN, you right-click on the directory or youd would like to go back and use "Merge" from the TortoiseSVN menu. Select the option "Merge two different trees." In the From section, select the revision header. In the "To" section, select the old revision + 1 (i.e. if you like to return to revision 169, enter revision 170 in the box).

0
source share

The easiest way is described in the SVN book :

 $ svn merge -c -303 http://svn.example.com/repos/calc/trunk 

This will cancel any changes made to change set 303, and you can review and commit them if necessary.

0
source share

All Articles