Team Foundation 服务器上变更集注释的位置?

发布于 2024-11-17 21:37:20 字数 175 浏览 9 评论 0原文

我的一位同事正在开发一个持续集成构建脚本,每次开发人员签入时都会生成一个新的构建,并在构建完成时向开发团队发送一封电子邮件。我们希望获取与签入相关的任何评论(与您通过右键单击项目文件并选择查看历史记录看到的评论相同)并将其包含在电子邮件中。但是,我们不确定 TFS 后端将脚本指向何处,以便它可以检索这些注释。有谁知道我们应该去哪里看?

One of my colleagues is working on a Continuous Integration build script that makes a new build every time a developer makes a checkin, and sends an email out to the development team when the build finishes. We want to take any comments associated with the checkin (the same comments you'd see by right-clicking on a project file and selecting View History) and include them in the email. However, we're not sure where in the back-end of TFS to point the script so it can retrieve those comments. Does anyone know where we should look?

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

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

发布评论

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

评论(1

池木 2024-11-24 21:37:20

您使用 TFS API 吗?如果是这样,您只需这样做:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http://WhateverServerUrl");
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
VersionControlServer VsServer = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
IBuildDetail build = buildServer.GetAllBuildDetails(new Uri("http://WhateverBuildUrl"));

List<IChangesetSummary> associatedChangesets = InformationNodeConverters.GetAssociatedChangesets(build);

foreach (IChangesetSummary changeSetData in associatedChangesets)
{
    Changeset changeSet = VsServer.GetChangeset(changeSetData.ChangesetId);
    string x = changeSet.Comment;
} 

如果您尝试在数据库中查找它,您可以查看变更集标题:

USE tfs_warehouse
SELECT [ChangesetID]
      ,[ChangesetTitle]
  FROM [tfs_warehouse].[dbo].[DimChangeset]

从这里向 id、日期等添加一个 where 子句。

这是数据存储在 TFS 中的位置2010。

在 TFS 2008 中,您将使用 TfsWarehouse 并查看 dbo.ChangeSet Changset 列。

Are you using TFS API for that? If so, you simply do:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http://WhateverServerUrl");
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
VersionControlServer VsServer = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
IBuildDetail build = buildServer.GetAllBuildDetails(new Uri("http://WhateverBuildUrl"));

List<IChangesetSummary> associatedChangesets = InformationNodeConverters.GetAssociatedChangesets(build);

foreach (IChangesetSummary changeSetData in associatedChangesets)
{
    Changeset changeSet = VsServer.GetChangeset(changeSetData.ChangesetId);
    string x = changeSet.Comment;
} 

If you are trying to look it up in the DB, you can look at the changeset title:

USE tfs_warehouse
SELECT [ChangesetID]
      ,[ChangesetTitle]
  FROM [tfs_warehouse].[dbo].[DimChangeset]

From here add a where clause to either the id, date etc.

This is where that data is stored in TFS 2010.

In TFS 2008, you would use TfsWarehouse and look at dbo.ChangeSet Changset column.

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