Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SVN-仅当没有冲突时才执行合并的批处理脚本_Svn_Batch File_Merge - Fatal编程技术网

SVN-仅当没有冲突时才执行合并的批处理脚本

SVN-仅当没有冲突时才执行合并的批处理脚本,svn,batch-file,merge,Svn,Batch File,Merge,我是批处理脚本的新手。 目前,我正在使用批处理脚本自动化一些发布过程任务。 在我的脚本中,我希望svn仅在没有冲突的情况下将sourceBranch合并到releaseBranch 我试过这样的方法: 集合/p合并状态=svn合并-c39%sourceBranchURL% 回显%MergeStatus% 但这是行不通的。“MergeStatus”不获取任何值,svn merge也不以这种方式工作。我的计划是在发生冲突时检查MergeStatus的值,如果存在冲突,则退出脚本 有人能帮我吗 提前感

我是批处理脚本的新手。 目前,我正在使用批处理脚本自动化一些发布过程任务。 在我的脚本中,我希望svn仅在没有冲突的情况下将sourceBranch合并到releaseBranch

我试过这样的方法:

集合/p合并状态=svn合并-c39%sourceBranchURL%

回显%MergeStatus%

但这是行不通的。“MergeStatus”不获取任何值,svn merge也不以这种方式工作。我的计划是在发生冲突时检查MergeStatus的值,如果存在冲突,则退出脚本

有人能帮我吗


提前感谢….

svn merge
没有任何退出代码

您始终可以执行测试合并并检查结果
svn合并--试运行

无冲突合并,根据svn帮助合并

For each merged item a line will be printed with characters reporting the
action taken. These characters have the following meaning:

    A  Added
    D  Deleted
    U  Updated
    C  Conflict
    G  Merged
    E  Existed
    R  Replaced

  Characters in the first column report about the item itself.
  Characters in the second column report about properties of the item.
  A 'C' in the third column indicates a tree conflict

不能将
C
字符作为合并状态,对于所有对象

是,我可以使用--dry run选项。但是如何检查批处理脚本中svn merge--dry run命令的输出呢?以下是我的批处理脚本:
svn merge-c39--干运行%sourcebranchrun%
svn commit-m“Merged%sourceBranchName%到%releaseBranchName%”
svn提交取决于我的合并--干运行输出。如果存在冲突,则我希望退出脚本。否则我就要承诺。我们该怎么做?@user3668231-smth。像
svn合并--干运行…|grep PATTERN-q
并且您必须只有智能模式,它捕获合并输出中的所有“C”(-q in grep“如果找到任何匹配项,立即以零状态退出”)