2015-06-05 17 views
0

我正在比较分支与svn mergeinfo http://myserver.com/branches/FeatureBranch http://myserver.com/branches/UAT --show-revs eligible,它显示是否有任何内容在功能分支中但不在UAT中。使用mergeinfo比较具有不同根的分支

但是,有人从分支创建了一个分支并进行了2次提交。当我运行命令时,它列出了原始分支的所有提交,而不仅仅是提交。这是我相信的预期行为,但是,我只想看到这两个提交。

svn log--stop-on-copy选项只显示日志中的两个提交,所以我想用mergeinfo命令来模拟类似的东西。然而,毫不奇怪,它不被支持。

'Subcommand mergeinfo' doesn't accept option '--stop-on-copy' 

如何模拟我感兴趣的行为? 也许一些bash从输出中删除小于分支创建版本的任何东西?

回答

0

只需通过-r从第二个分支点开始的版本范围。

OP评论: 这使得脚本是这样的:

echo "Checking if there are commits beyond the code freeze" 
svn log --xml --stop-on-copy $UAT|grep msg|cut -d\> -f2|cut -d: -f1|sort -u|while read branch 
do 
    if [ "$branch" != "" ]; then   
     echo "Checking branch: $branch" 
     branchVersion=$(svn log --xml --stop-on-copy $Branches/$branch|grep revision|tail -1|awk -F\" '{ print $2 }') 
     eligibleRevisions=$(svn mergeinfo -r$branchVersion:HEAD $Branches/$branch $UAT --show-revs eligible) 
     if [ "$eligibleRevisions" != "" ]; then 
      echo "Branch $branch Created at $branchVersion"   
      echo "svn mergeinfo -r$branchVersion:HEAD $Branches/$branch $UAT --show-revs eligible" 
      echo "$eligibleRevisions" 
     fi 
    fi 
done