开发者

What is the best way to merge specific changes in several branches and trunk?

开发者 https://www.devze.com 2023-01-26 10:14 出处:网络
I used SVN/CVS for a long time just as a place where my code stored is. B开发者_运维知识库ut now I came to a point where I need a \"best way to do\".

I used SVN/CVS for a long time just as a place where my code stored is. B开发者_运维知识库ut now I came to a point where I need a "best way to do".

We have several branches.

For Example:

  • Release1 (shipped),
  • Release2 (not finished, contains new features),
  • Fix1 (contains bug fixes for Release1 and will be shipped after customer tests),
  • Fix2/trunk (The trunk is our current development state with Fix2).

And now we come to my problem.

I cannot say if Release 2 is shipped before Fix1 or Fix2 and I have now a Hotfix for Release1. Just a few files, but it was urgent.

What is now the best way to get the changes in all branches?

Auto merge will also merge differences that are branch specific. Is the best way to merge it by hand?

There has to be a way like: I mark my change with ID "abc" and say merge only changes of abc in all branches.

Btw. I am using Eclipse with Subversive. Maybe a tool outside eclipse will be better!?


I use Subclipse plugin for Eclipse. You can probably do this with svn command line also. If your fix is isolated to a single revision number then you can merge just that revision to the trunk(or any other branch).

  • branch1 (revision 103) -hotfix
  • trunk (revision 100)

Using Subclipse, you can right click the file then choose "Team"->"Merge." Select either "Merge a range of revision" or "Merge two different trees" option then provide the source url and revision to merge to the target tree.

From command line... given that your current working directory is the trunk:

svn merge -r 103:103 http://svn/branches/branch1

You probably can't merge to multiple branches and that's probably better because you want to be careful with the merge process.

0

精彩评论

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