开发者

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:

  1. Opened both the trunk and branch projects in separate Visual Studio instances
  2. 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.
  3. 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.)
  4. Tried to build the project, which usually caused compile errors
  5. Based on the errors, merged other files with WinMerge until I had a clean compile
  6. Repeated the steps above until all my desired features were merged
  7. Tested all the merged features

It went pretty smoothly, once I figured out the basic approach.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜