1

I accidentally committed a change in branches/2.1/foo.cpp instead of branches/2.0/foo.cpp.

The most straightforward way to fix this seems to be to merge the change back to 2.0:

~/branches/2.0 $ svn merge svn://repository/branches/2.1/foo.cpp foo.cpp

But, according to this document this should be avoided:

Avoid subtree merges and subtree mergeinfo. Perform merges only on the root of your branches, not on subdirectories or files

What would be the best way to go about then?

StackedCrooked
  • 34,653
  • 44
  • 154
  • 278

2 Answers2

1

Undo the erroneous commit as per Retract accidental checkin .

Then do whatever you wanted originally.

Community
  • 1
  • 1
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
-1

You should do a merge of the specific revision in this case. Assuming there is not other stuff mixed into the revision that you don't want to merge, you might have a command something like this:

~/branches/2.0 $ svn merge -r4567 svn://repository/branches/2.1 .

ioscode
  • 801
  • 4
  • 12