2011-12-28 64 views
5

我們有一個NAnt腳本來更新TFS中的「預構建」程序集,作爲我們的TeamCity構建項目之一。構建由其他構建觸發。它執行TF簽出,移動一些文件,然後執行TF簽入。TF錯誤:沒有剩餘的更改

相關目標(TF解析爲TF.exe的路徑):

<target name="checkin.assemblies"> 
    <exec program="${tf}"> 
    <arg value="checkin" /> 
    <arg value="${dir.assemblies}" /> 
    <arg value="/comment:${message}." /> 
    <arg value="/noprompt" /> 
    <arg value="/recursive" /> 
    </exec> 
</target> 

定期得到:

Checking in edit: ... 
The following changes were not checked in because the items were not modified. 
Undoing edit: ... 
There are no remaining changes to check in. 
External Program Failed: E:\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe (return code was 1) 
Process exited with code 1 
BUILD FAILED - 0 non-fatal error(s), 1 warning(s)

我認爲正在發生的是構建被觸發一次太多時間(有幾個版本可以觸發它)。如果我們要更新的文件沒有更改,TFS將跳過檢入並「有幫助」地返回錯誤代碼。不幸的是,它也會返回1,因爲這是嚴重的「鎖定退房」錯誤。

參考:TF Command-Line Exit Codes

的解決方法是簡單的,但惱人的 - 斷火的建立,將碰到一個集的版本號,然後觸發此版本之一。

我們如何可靠地完成這項工作?

更新:我們最終修改了TeamCity的構建觸發配置,以創建構建「鏈」,確保checkin只觸發一次。

回答