TF错误:没有剩余的更改需要签入

时间:2011-12-28 15:48:05

标签: tfs teamcity nant

我们有一个NAnt脚本来更新我们在TFS中的“预构建”程序集作为我们的TeamCity构建项目之一。构建由其他构建触发。它会进行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的构建触发配置,以创建构建“链”,确保只会触发签到一次。

1 个答案:

答案 0 :(得分:9)

tf checkin有一种名为/force的文档命令行参数。它列在in the usage and on MSDN中,但在任何地方都没有描述。

这会设置CheckinParameters.AllowUnchangedContent标志,并允许您签入没有更改的文件。这应该可以解决你的问题。