Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to I replace all code in trunk with my old code?

Tags:

merge

svn

A partner and I are using svn for a partner project for a class, and we initially went the wrong direction with the code in our trunk. We got to revision 129 before realizing we would be better off starting over from revision 113, and going a different direction.

On my own computer I checked out revision 113, made the changes, and want to commit the code I have. However, when I try to commit I get this:

svn: Commit failed (details follow):
svn: File or directory 'Robot.cpp' is out of date; try updating
svn: resource out of date; try updating

The problem is, I don't want to update. I don't want all the changes we made from revision 113 to 129, and basically want to replace all the code in the repository with what I have locally. How would I do this?

like image 404
maccam912 Avatar asked Nov 27 '12 15:11

maccam912


2 Answers

Being at the root of your working copy, you can issue the following command:

svn merge -rHEAD:113 .

This will 'undo' all your changes from revision 113 so that your revision 130 will look like revision 113.

Don't forget to commit afterwards though.

like image 182
Yannick Blondeau Avatar answered Oct 15 '22 11:10

Yannick Blondeau


  • Tag current trunk so you have a backup
  • Checkout the current copy into a new folder
  • Rollback all changesto version 113: svn merge -c 113 and then svn commit -m "rolledback to 113".
  • In your current working directory: svn update
  • Then svn commit.
like image 30
Candide Avatar answered Oct 15 '22 10:10

Candide