查找更改集之间受影响的文件

查找更改集之间受影响的文件

本文介绍了TFS:查找更改集之间受影响的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用的是 Team Foundation Server 2012.

We are using Team Foundation Server 2012.

我们有一个人在 2016 年 8 月 9 日在 Changeset 13646 中提交了 97 个文件(不包括设计者和资源文件).

We had a guy submit 97 files (not counting the designer and resource files) in Changeset 13646 on 8/9/2016.

十 (10) 天后,即 2016 年 8 月 18 日,他在变更集 13716 中回滚了这些更改.

Ten (10) days later on 8/18/2016, he rolled these changes back in Changeset 13716.

在此期间,提交并完成了其他工作项.

During that time, other work items were submitted and completed.

是否有某种方法可以查询 TFS 以查找包含在 13646 和 13716 之间的任何变更集中的文件名工作项?

Is there some way to query TFS to find the Filenames and WorkItems that were included in any Changeset between 13646 and 13716?

我希望这是一个可以在 SQL Server Management Studio 中运行的 SQL 查询.

I would like this to be an SQL query that I can run in SQL Server Management Studio.

推荐答案

虽然这是针对 TFS 2013 的,但我希望它在 2012 年有效.这是针对 tfs_warehouse 数据库运行的

Though this is for TFS 2013 I'm hopeful it works in 2012. This was run against the tfs_warehouse database

 SELECT DISTINCT df.[FileName]
    ,df.FilePath
    ,dcs.ChangesetID AS 'ChangeSetID'
    ,dwi.System_id AS 'WorkItemID'
    ,dwi.System_WorkItemType
    ,dwi.System_State
    ,dwi.System_CreatedDate
    ,dwi.System_ChangedDate

FROM DimFile df
JOIN FactCodeChurn fcc ON df.FileSK = fcc.FilenameSK
JOIN FactWorkItemChangeset fwi ON fcc.ChangesetSK = fwi.ChangesetSK
JOIN DimWorkItem dwi ON fwi.WorkItemID = dwi.System_id
AND fwi.TeamProjectCollectionSK = dwi.TeamProjectCollectionSK
AND fwi.RemovedDateTime = CONVERT(DATETIME, N'9999', 126)
JOIN DimChangeset dcs ON dcs.ChangesetSK = fcc.ChangesetSK

WHERE dcs.ChangesetID BETWEEN 13646 AND 13716

ORDER BY dcs.ChangesetID

文件路径中也有文件名,但我想我会将文件名作为单独的字段包含

The file path does also have the filename within it, but I thought I would include the filename as a separate field

这篇关于TFS:查找更改集之间受影响的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 08:38