Suggestions on doing a difficult WinForms merge with subversion?
My manager wants me to move some specific features from our Subversion trunk to the branch we used for a beta release some months ago.
This is a multi-project, VS2008 solution using WinForms. The other projects are mainly support DLLs for the main project, which is mostly UI code.
We use both Ankh and Tortoise.
There have been multiple changes in all the projects, but I only want to merge some of the changes into the branch.
I've been using TortoiseMerge, merging my main form, compiling, and then merging associated projects based on compile errors, but it's going very slowly.
Problems I've been running into:
- merging changes to forms that touch both .cs and .d开发者_开发百科esigner.cs files
- changes that are dependent on changes to other projects, which cascade to yet more projects, etc.
Any suggestions on a better way to proceed?
If you have access to command line, you could try to generate patches from each branch (or trunk) with svn diff
by specifying the min and max revisions containing the specific features you need to move.
These patches (probably) won't apply automatically on your target branch, but the amount of rework will be minimized. Of course, you should start with the oldest features and work your way back to head.
EDIT
I am having another idea/suggestion. You could synchronize the content of your beta target branch with what is on trunk and then disactivate the features your boss does not want on the beta branch. It could mean less work than moving features patch by patch.
After quite a bit of futzing around with SVN merging, I've come to the conclusion that my best approach is to manually merge my desired features to the beta branch.
Seems to be the best way to fully control the process, and only get the changes I want.
The Winforms .designer.cs files are the biggest problem. The VS designer moves things around a lot when you add new controls, and this creates all kinds of conflicts when trying to merge, which are difficult to resolve.
Edit
Here's what I ended up doing:
- Opened both the trunk and branch projects in separate Visual Studio instances
- For each form, copied and pasted new controls from trunk to branch, using the VS IDE designers. This ensured that the .designer.cs files would be valid.
- Used WinMerge to merge the form's .cs file, on a line by line basis, so I only picked up the changes I wanted. (In some cases - when I wanted all the changes - I just copied the entire file(s) from trunk to branch folders.)
- Tried to build the project, which usually caused compile errors
- Based on the errors, merged other files with WinMerge until I had a clean compile
- Repeated the steps above until all my desired features were merged
- Tested all the merged features
It went pretty smoothly, once I figured out the basic approach.
精彩评论