TFS 中的自定义签入策略? [英] Custom Check in policy in TFS?

查看:31
本文介绍了TFS 中的自定义签入策略?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的项目中有一些 xml 文件,每当我们将这些 xml 文件签入到 TFS 中时,我们都确保在签入之前已将这些 xml 文件添加到专有应用程序中.

We have some xml files in the our project and whenever we check-in these xml files into TFS, We have make sure before checking-in that we have added those xml files to proprietary application.

现在新员工更经常忘记在签到前将文件添加到专有应用程序中,这变得越来越严重......

Now the new employees more often forget to add files into proprietary application before check-in and this is getting serious...

我们想要一个确认对话框(提醒),询问开发人员是否已将 xml 文件添加到应用程序中.如果是,则签入否则保持签出...

We want kinda confirmation dialog (a reminder) asking the developers if they have added the xml files into the app. If yes then check-in otherwise keep it checkedout...

请提出这样的事情是否可行,任何相关的代码或链接将不胜感激.

Please suggest if such thing is possible and any relevant code or links will be really appreciated.

推荐答案

在自定义签入策略中提升 UI 是不合适的 - 签入策略的生命周期很短,并且它们会被频繁评估并且不一定在 UI 上下文或 UI 线程中.

It's not appropriate to raise UI in a custom check-in policy - the lifecycle of a check-in policy is very short, and they will be evaluated frequently and not necessarily in a UI context or on the UI thread.

您能否以编程方式确定是否正在签入适当的 XML 文件?如果是这样,您可以创建一个自定义签入策略,如果 XML 文件未挂起添加,则该策略将失败.

Can you determine programmatically whether the appropriate XML files are being checked in? If so, you could create a custom check-in policy that fails if the XML files are not pended for add.

Gated Check-in 可能是这个问题的最佳解决方案:如果这些 XML 文件不存在,构建是否会失败 - 或者如果这些文件丢失,单元测试是否会失败?如果是这样,这是门控登记的完美候选,这将防止发生这些登记.

Gated Check-in may be the best solution to this problem: does the build fail if these XML files do not exist - or would unit tests fail if these files are missing? If so, this is a perfect candidate for Gated Check-in, which will prevent these check-ins from occurring.

这篇关于TFS 中的自定义签入策略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆