一. 进入Version Control中的Subversion Working Copies Infomation页面
具体操作:可在View-->Tool Windows-->Version Control 中打开(或者直接使用快捷键Alt+9)
二. Configure Branches
①. Branches location
特别注意,在配置Branches location时,如下图所示,可能你倾向于设置branches location为PPMO/src/KT_PPMO_1.4.00_03.但是很遗憾的是,我在合并的过程中会出现[Tree conflict]的异常提示.
三. Merge From[合并]
由于我的SVN目录中存在中文,因此该处分支显示中看起来像乱码,另外示例中的KT_PPMO_1.4.10是从KT_PPMO_1.4.00上分支出来的,但是在此过程中,因为需要修正bug,由此分支出了KT_PPMO_1.4.00_01~KT_PPMO_1.4.00_04,现在我要把这四个分支中的改动都合并到最新的KT_PPMO_1.4.10版本中.
四. 合并模式选择
IntelliJ IDEA给我们提供了三种合并模式.再次我尝试了一种.Quick Manual Select[快速手动选择]
特别注意,要使得合并生效,请勾选Integrate Project选项卡中的Use ancestry选项卡而非try merge,but make no changes. 我曾经使用了[try merge,but make no changes]选项,一直同步不下来,踩了半天的坑.(当然,Integrate Project选项卡默认就是选中Use ancestry的.我在研究Integrate Project选项卡时改动了该配置项.)
Integrate Project[整合项目]
很遗憾的是,在尝试使用IntelliJ IDEA的[Integrate Project]功能时,发现总是报以下的错误.
Error:svn: E160013:
'/svn/Android/!svn/rvr/8338/PPMO/src/%25E5%2593%2581%25E7%2589%258C/KT_PPMO_1.4.10' path not found
至今仍未解决.
参考链接:
IntelliJ IDEA SVN 分支代码合并(图文详解)
Why am I getting tree conflicts in Subversion?
I don't know if this is happening to you, but sometimes I choose the wrong directory to merge and I get this error even though all the files appear completely fine.
Example:
Merge /svn/Project/branches/some-branch/Sources to /svn/Project/trunk ---> Tree conflict
Merge /svn/Project/branches/some-branch to /svn/Project/trunk ---> OK
This might be a stupid mistake, but it's not always obvious because you think it's something more complicated.