首页新闻找找看学习计划

svn merge配置,传给第三方软件的文件路径是临时文件。

0
[已关闭问题] 关闭于 2015-09-10 20:39

我安装了slikSVN,在做svn与beyond compare集成的是否发现。svn传给第三方软件的路径参数都是临时路径。导致merge之后,找不到自动保存地址。

config文件的部分配置:

[helpers]
# diff-cmd = diff_program (diff, gdiff, etc.)
diff-cmd = F:\Tools\Peter script\diffwrap.bat
# diff3-cmd = diff3_program (diff3, gdiff3, etc.)
diff3-cmd = F:\Tools\Peter script\diff3wrap.bat

在文件diff3wrap.bat中,我将传进来的参数进行打印,输出到svn.log文件中。
文件diff3wrap.bat的内容:

@ECHO OFF
REM Configure your favorite diff3/merge program here.
SET DIFF3="bcompare"
REM Subversion provides the paths we need as the last three parameters.
REM These are parameters 9, 10, and 11. But we have access to only
REM nine parameters at a time, so we shift our nine-parameter window
REM twice to let us get to what we need.
SHIFT
SHIFT

echo cd: %cd% >> C:\log\svn.log
echo 0: %0 >> C:\log\svn.log
echo 1: %1 >> C:\log\svn.log
echo 2: %2 >> C:\log\svn.log
echo 3: %3 >> C:\log\svn.log
echo 4: %4 >> C:\log\svn.log
echo 5: %5 >> C:\log\svn.log
echo 6: %6 >> C:\log\svn.log
echo 7: %7 >> C:\log\svn.log
echo 8: %8 >> C:\log\svn.log
echo 9: %9 >> C:\log\svn.log
echo ========================== >> C:\log\svn.log rem %2 %3 %1 %4 SET MINE=%7 SET OLDER=%8 SET YOURS=%9 REM Call the merge command (change the following line to make sense for REM your merge program). %DIFF3% --older %OLDER% --mine %MINE% --yours %YOURS% /title1=old /title2=mine /title3=local rem %DIFF3% %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9 REM After performing the merge, this script needs to print the contents REM of the merged file to stdout. Do that in whatever way you see fit. REM Return an errorcode of 0 on successful merge, 1 if unresolved conflicts REM remain in the result. Any other errorcode will be treated as fatal.

最后在svn.log里,得到的结果如下: 

cd: G:\YH\codes\branch\v5.6\src\g5 
0: -m 
1: -L 
2: .mine 
3: -L 
4: .r27833 
5: -L 
6: .r27869 
7: G:\YH\codes\.svn\tmp\svn-4C77CBE4 
8: G:\YH\codes\.svn\pristine\58\587d96b99363d2088f68761624eef706718a2624.svn-base 
9: G:\YH\codes\.svn\pristine\c0\c028fdf78c4962826d834f5c7bc2ab480e1357ed.svn-base ========================== 

只有参数7,8,9是文件路径,但是这些路径都是.svn总的文件。根本找不到merge后,目标文件应该保存在哪里。 
%9后面的参数没有参数了。我是试过了。

 

不知道是否是我的subversion的某些配置导致的如此情况。希望大家帮我出出主意!

问题补充:

我刚刚查找的结论是,在使用第三方软件merge之后,第三方软件会将merge后的内容返回来。在写入文件。

资料如下:

REM After performing the merge, this script needs to print the contents
REM of the merged file to stdout. Do that in whatever way you see fit.
REM Return an errorcode of 0 on successful merge, 1 if unresolved conflicts
REM remain in the result. Any other errorcode will be treated as fatal.

但是,我使用bcompare,merge之后,被merge的文件内容变成了空。也就是没有返回成功。为什么?

bcompare似乎必须设置第4个文件路径,否则退出时,它要求你保存merge后的结果。

闫冬 的地盘的主页 闫冬 的地盘 | 菜鸟二级 | 园豆:218
提问于:2015-09-08 09:44
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册