TFS:如何自动添加签到评论
我想知道最终是否有可能通过使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题是,仅当从同一 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.
在不了解 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.
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.