5

something that shouldn't happen, happened to me today. We were working on a feature branch in svn (Server afaik 1.6, client 1.7). This branch was reintegrated yesterday, while i was not in the office. Now i'm left with some local changes in my working copy, pointing to the already reintegrated branch. Of course its partially my fault of leaving changes locally after work, but thats another story ;-)

I know that reintegrating the branch again is not an option, so What are the best ways to bring my changes into the trunk? A Coworker suggested using patches, which i never used before. I also thought about cherry picking my changes, after commiting them into the branch, but i'm not sure if this would work. Are there any other options?

Any help is greatly appreciated.

Best regards Nico

dowhilefor
  • 10,971
  • 3
  • 28
  • 45

2 Answers2

4

After reintegration, the branch and the trunk should be identical (let's say the head revision is at 100). So, you could just commit your changes in the feature branch (creating rev 101), and merge to the trunk the feature branch from 100 (exclusive) to 101 (inclusive). Then delete the feature branch.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • What about "don't reintegrate a branch that was already reintegrated"? – dowhilefor Dec 15 '11 at 11:32
  • Where did I tell you to reintegrate the branch? I told you to merge a revision from the feature branch to the trunk, and then delete the feature branch. There is no reintegration happening here. The operation I suggest is the same thing as a patch, but without the need for creating and applying the patch. – JB Nizet Dec 15 '11 at 11:35
  • I see, for me "merge to the trunk from a branch" meant somehow reintegrate. So it was a misunderstanding. Thanks for the clarification. – dowhilefor Dec 15 '11 at 11:45
1

Create a new branch for your features and switch (as in svn switch) the uncommitted working copy to it. Test, commit, and then merge into trunk.

thiton
  • 35,651
  • 4
  • 70
  • 100
  • A new branch from the branch? Wouldn't that violate the "don't reintegrate a branch that was already reintegrated" rule? Or a branch from the trunk? – dowhilefor Dec 15 '11 at 11:33
  • @dowhilefor: For an integrated branch, it doesn't matter. I thought your branch has already been deleted, so the trunk would be the only choice. The "don't reintegrate a branch that was already reintegrated" is pretty shady and has no point in newer SVNs with merge history support. – thiton Dec 15 '11 at 11:35