3

During the process of development, I made a few mistakes in code, and accidentally committed before discovering the errors. The changes in code between my revision 259 and 261 are pretty significant.

Is there a way to after reverting to 259, to go forward and have 260 and 261 be wiped out?

I'm using tortoisesvn, and assembla svn.

PhoenixLament
  • 741
  • 1
  • 11
  • 32

3 Answers3

6

The proper way would be to revert those commits, that is add new commits which cancel the modifications introduced by 260 and 261: see "SVN Revert Trunk, remove a revision as if it never existed?"

svn merge -r [current_version]:[previous_version] [repository_url]
svn commit -m “Reverting previous commit and going back to revision [previous_version].”

If you're using TortoiseSVN, you could just show the logs, select the commit, and choose "Revert changes from this revision" in the context menu.

See also "SVN - delete a revision, or make an older revision the head".

But the other way, more radical, is to dump and reload the SVN repo, removing the unwanted revisions.

I prefer the first solution, but it depends on what you want.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

I wound up copying the files out of the 'working copy' to the 'broken' copy and comitted.

PhoenixLament
  • 741
  • 1
  • 11
  • 32
0

VonC got it. You use the svn merge to revert your revision. However, I would use the -c flag. Let's say you made a mistake in revision 1234, go to your working directory and say:

$ svn merge -c -1234 .

This will remove revision 1234 from your current working directory. This is the same as:

$ svn merge -r1235:1234 .

but, the -c syntax is easier to understand. Use svn log to find the revisions where you made a mistake, and revert those. This will pretty much work even if other people have submitted revisions after yours -- as long as none of those changes are dependent upon your changes.

Community
  • 1
  • 1
David W.
  • 105,218
  • 39
  • 216
  • 337