如何合并两个subversion分支(Merge Branch 7.3到Branch RC)

时间:2013-07-07 06:26:33

标签: svn branching-and-merging

我查看了svnmerge和常规svn,但是说明要么指的是合并分支到主干,要么步骤不同

就svnmerge.py而言,这就是我所做的

mkdir MERGE
cd MERGE
svn co https://svn.hq.cod.corp/co/perlapp/branches/RC
cd RC-MOVEAPRIL13-1
svnmerge.py init

cd ..
svnmerge merge https://svn.hq.co.corp/co/perlapp/branches/7.3
Nothing happened

then:
cd MERGE/RC
svn merge -S https://svn.hq.co.corp/co/perlapp/branches/7.3

现在,我怎么知道7.3确实合并了?它发生得很快,所以我觉得什么都没发生。

建议使用Temp RC分支,并合并到Temp RC分支,而不是真正的目标RC分支。

另一种方式,似乎是:

$ svn co https://svn.hq.cod.corp/co/perlapp/branches/RC
$ cd RC
$ svn merge --ignore-ancestry https://svn.hq.cod.corp/co/perlapp/branches/RC https://svn.hq.co.corp/co/perlapp/branches/7.3 .
# Check the diff to see if it merged properly
$ svn diff | less

没试过那个

也:

svn merge -dry-run -r 221381:259009 https://svn.hq.co.corp/co/perlapp/branches/7.3 https://svn.hq.cod.corp/co/perlapp/branches/RC出错:

svn:尝试'svn help'获取更多信息 svn:无法指定具有两个URL的修订范围

请记住,我想合并FROM“7.3”分支,TO“RC”分支,最终结果为RC,包含所有提交到“7.3”

svn info网址:

kahmed@cr23788-kahmed:/media/Hitachi/3/SVN-MERGE-7.3_to_RC/RC$ 
kahmed@cr23788-kahmed:/media/Hitachi/3/SVN-MERGE-7.3_to_RC/RC$ svn info https://svn.hq.co.corp/co/perlapp/branches/build_7.3
Path: build_7.3
URL: https://svn.hq.co.corp/co/perlapp/branches/build_7.3
Repository Root: https://svn.hq.co.corp/co
Repository UUID: 1a64bf25-e0e5-0310-b6f3-de1d3c99dda3
Revision: 259054
Node Kind: directory
Last Changed Author: mk
Last Changed Rev: 259009
Last Changed Date: 2013-07-05 11:45:26 -0400 (Fri, 05 Jul 2013)

kahmed@cr23788-kahmed:/media/Hitachi/3/SVN-MERGE-7.3_to_RC/RC$ svn info https://svn.hq.co.corp/co/perlapp/branches/RC
Path: RC
URL: https://svn.hq.co.corp/co/perlapp/branches/RC
Repository Root: https://svn.hq.co.corp/co
Repository UUID: 1a64bf25-e0e5-0310-b6f3-de1d3c99dda3
Revision: 259054
Node Kind: directory
Last Changed Author: jc
Last Changed Rev: 259052
Last Changed Date: 2013-07-08 06:58:02 -0400 (Mon, 08 Jul 2013)

kahmed@cr23788-kahmed:/media/Hitachi/3/SVN-MERGE-7.3_to_RC/RC$ svn merge --dry-run http://svn.hq.co.corp/co/perlapp/branches/build_7.3
svn: 'https://svn.hq.co.corp/co/perlapp/branches/RC' isn't in the same repository as 'http://svn.hq.co.corp/co'

1 个答案:

答案 0 :(得分:0)

  1. 您必须使用普通合并(来自svn help merge的第一个表单)
  2. 我不知道任何合并的-S选项
  3. 常见模式

    mkdir RC
    cd RC
    svn co https://svn.hq.cod.corp/co/perlapp/branches/RC
    svn merge --dry-run https://svn.hq.co.corp/co/perlapp/branches/7.3
    

    (检查结果,在“树冲突”的情况下更多地考虑解决问题,如果“冲突”使合并前选择正确版本或合并为GUI风格与视觉合并以解决冲突)

    和...

    svn merge https://svn.hq.co.corp/co/perlapp/branches/7.3