Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

subversion: merge without a working copy

Tags:

merge

svn

I want to revert a bad commit from command-line svn. The usual advice is to reverse merge the commit into your working copy and then commit the changes. In my case, the bad commit was a mis-typed svn import which trashed a portion of my repository I don't have checked out anywhere else. I could check out the affected directories and then follow the usual advice, but it would be more elegant if I could reverse-merge entirely using URLs, without a working copy. Is this possible?

like image 479
Isaac Sutherland Avatar asked Jul 15 '12 00:07

Isaac Sutherland


1 Answers

No, you can't simply merge via the URL because that would mean merging without even seeing the resulting merge -- a very bad practice.

There is a situation where this wouldn't be bad:

  • Someone did a terrible and massive change in revision 455, the current version. You could easily restore the repository to version 454 without worrying too much. No real need to see what the end result will be.

However, imagine this:

  • Someone did a terrible and massive change in revision 455. The current revision is now 460. There are now five new changes in Subversion. You can back out change set 455 like you did in the previous example, but you wouldn't get revision 454. Instead, you get revision 454 with the changes made in revisions 456 to 460. Some of those changes may be independent of the mess revision 455 made. Some of those changes may be due to changes made in revision 455.

I understand that there is now a big mess to clean up, but the reason you have that mess is because someone committed changes via the svn import command without first having to verify them before committing them. It's the reason I discourage use of the svn merge command.

like image 155
David W. Avatar answered Oct 04 '22 08:10

David W.