TFS:如何自动添加签到评论

发布于 2024-09-11 00:02:42 字数 408 浏览 0 评论 0原文

我想知道最终是否有可能通过使用 SDK 开发一些东西,在 TFS 中签入时自动提供签入注释。

更新:我尝试使用 SDK API,如下所示:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsName); tfs.EnsureAuthenticated(); VersionControlServer versionControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); versionControl.CommitCheckin += VersionControlOnCommitCheckin;

但该事件似乎没有被触发。我做错了什么吗?

I would like to know if it's possible, eventually by developing somethng using the SDK, to provide a check-in comment automatically when checking-in in TFS.

UPDATE: I tried using the SDK API like so:


TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsName);
tfs.EnsureAuthenticated();
VersionControlServer versionControl = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
versionControl.CommitCheckin += VersionControlOnCommitCheckin;

But the event does not seem to be fired. Is there anything blatantly wrong I'm doing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

帅哥哥的热头脑 2024-09-18 00:02:43

问题是,仅当从同一 API 实例(即同一计算机、同一进程、同一 AppDomain)执行操作时,才会引发我的问题中所示的 TFS API 事件。

The problem is that the TFS API events used as shown in my question are raised only when the operations are performed from the same API instance, thus same machine, same process, same AppDomain.

顾北清歌寒 2024-09-18 00:02:43

在不了解 TFS 的情况下,这听起来似乎与提交评论的目的背道而驰。您应该在签入评论中包含有关事情发生变化的原因的有用的高级信息。如果人们只是想知道发生了什么变化,他们可以查看差异。自动生成评论似乎违背了这一点。

Without knowing anything about TFS, that sounds like it runs counter to the purpose of having a commit comment. You're supposed to include useful high-level information in a check-in comment about why things have changed. If people just want to know what has changed, they can look at diffs. Automatically generating a comment would seem to be defeating the point.

守不住的情 2024-09-18 00:02:43

SDK 和命令行都允许您指定签入注释。如果您打算在人员从 Visual Studio 中签入时执行此操作,则必须考虑一些自动化,但是,在 VS2010 中,使用 DTE/MEF 应该相对简单。

我们有几个执行签入的自动化流程,并且我们指定注释以表明签入是作为自动化流程的一部分发生的。

Both the SDK and the command line allow you to specify the check-in comment. If you're looking at doing this when the person checks in from within Visual Studio, you'll have to look at some automation, but, with VS2010, it should be relatively straightforward using DTE/MEF.

We have a couple automated processes that do check-ins, and we specify the comment to indicate that the check-in occurred as part of an automated process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文