How do I make/apply a diff patch to this situation?
Question
I have a project, for example WORDPRESS. and I am use SVN.
I have following copies:
A. WP2.6 from wordpress.org
B. WP2.6, I modify some core files (add/del/change some files' code)
C. WP2.7 from wordpress.org
I would like update Version A to C and keep the changes of version B.
some of my changes maybe like that:
Version A code:
123 123
Version B code:
123 x 123
Version C code:
123 123 123
expected final version:
123 x 123 123
How can I make/apply patch to this project ? any faster/easier way if I have 100+ different files
maybe I thinking in wrong way. please suggest to make it right. thanks.
Solution
(Simplistic Answer): There's no fully automatic way to do this - you will need to branch and merge, and merging will mean you have to look at your modifications, and test them.
- Start with (A) as /trunk, checked out into your working copy
- Create a "vendor" branch for WP2.6
- Copy (B) into the trunk. Take care to svn rm and svn mv deleted and renamed files, and commit to the trunk
- Switch the working copy to the (A)-WP2.6 branch
- Copy (C) into this branch (Again, don't forget svn mv and svn rm if needed), and commit
- Switch the working copy back to the trunk
- Merge from the WP2.6 vendor branch back into the trunk (this is where most of thehard work will be)
- Test it out to whatever degree of confidence you need before committing to the trunk
- Repeat for future releases
To illustrate the sort of difficulty that can't normally be solved automatically, consider this: in your example, the hoped-for final version could be either of these:
123 x 123 123
123 123 x 123