TFS客户端挂钩 [英] TFS Client side hook

查看:152
本文介绍了TFS客户端挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经使用TFS作为版本控制.目前,项目管理是通过我们本地的PMS应用程序完成的.我们有一个要求,例如团队成员签入项目,显示用于输入任务详细信息的自定义对话框以及更新本地pms数据库的要求.我想显示一个自定义对话框,该对话框和/或在调用check-in命令之后.此外,请确保只有通过此自定义对话框成功提交任务详细信息,我们才能签入项目.

We have using TFS as version control. Currently the project management is done through our local PMS application. We have a requirement like when a team member check in the project, show a custom dialog for entering task details and update our local pms database. I want to show a custom dialog box that and/or after the check-in command is invoked. Also ensure that only successful submission of task details through this custom dialog boxes, we can checkin the projects.

推荐答案

创建自己的签入策略

您可以通过入住"政策来执行此操作. 查看我关于与用户互动的博客文章在办理登机手续时.基本技巧是引发签入警告,用户可以单击该签入警告,在单击事件上,您可以向用户显示UI并使用标准Windows窗体功能与您的系统进行交互.

Creating your own checkin policy

You can do this through a Check-in policy. Check out my blog post on interacting with the user on check-in. The basic trick is to raise a check-in warning which the user can click, on the click event, you can show UI to the user and use standard Windows Forms functionality to interact with your system.

在此StackOverflow问题中可以找到最多的基本示例代码.

The most basic example code can be found in this StackOverflow question.

我的多个分支机构策略使用了这一技巧要求用户确认用户是否真的想同时将代码签入多个分支,而不必使用绕过策略验证复选框.

My multiple Branch policy uses this trick to ask a user to confirm whether the user really wants to check in code to multiple branches at the same time without having to use the bypass policy validation checkbox.

将Team项目配置为使用签入策略后,签入时未在计算机上安装该策略时,Visual Studio会进行投诉.没有简单的方法来分发签入策略以确保每个用户都在计算机上安装了它,或者将自动从TFS安装它.

After configuring the Team project to use the checkin policy, Visual Studio will complain when the policy is not installed on the machine upon checkin. There is no easy way to distribute checkin policies to ensure that every user has it installed on their machine, or will automatically get it installed from TFS.

在签入策略中,您可以通过IPolicyDefinition.InstallationInstructions为策略包的位置提供URI.程序包可以是.msi.vsix或只是一个zip文件,该文件带有脚本以复制程序集并添加所需的注册表项. Visual Studio不在乎您选择的方法.如果您的公司托管自己的Visual Studio库,则可能指向在那里也有下载位置.

In your checkin policy you can provide a URI to the location of the policy package through the IPolicyDefinition.InstallationInstructions. The package can be a .msi, a .vsix or just a zip file with a script to copy the assembly and add the required registry key. Visual Studio doesn't care about the method you choose. If your company hosts their own Visual Studio gallery, it could point to the download location there as well.

如果选择.msi,则可以通过组织中可用的现有置备工具来分发它们.

If you pick an .msi you could have them distributed through existing provisioning tools that might be available in your organisation.

未安装该策略的客户端将在签入时自动触发警告,该警告只能通过选中绕过签入策略"复选框来消除.可以撤消该权限,要求所有用户正确设置他们的计算机.

Clients that do not have the policy installed will automatically trigger a warning on checkin that can only be dismissed by checking the "bypass checkin policy" checkbox. That permission can be revoked, requiring all users to setup their machine correctly.

还有另一种分发签入策略的方法,

There is one more way to distribute checkin policies, which is through the Visual Studio Power tools. By checkin in the policies in Source Control in a specific folder and telling the Power Tools to download custom binaries (work item controls and checkin polciies), they will be installed automatically. Since these tools are not installed by default, not configured by default they need about the same amount of work to make this scenario work for you.

这篇关于TFS客户端挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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