2015-06-05 23 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