一种在 TFS 2008 中找出工作项或 chgset 组的所有受影响文件的方法?

发布于 2024-08-23 11:27:29 字数 428 浏览 5 评论 0原文

我正在尝试找出一种方法来找出哪些文件受到 TFS 2008 中的工作项的影响。

我意识到这是与此处其他人已经提出的问题重复的 - 查看作为工作项的一部分更改的所有文件的列表TFS,但没有得到答复,我断断续续地寻找这个有一段时间了。

据我了解,可以查看工作项的链接选项卡,然后查看每个变更集以查看已更改的文件。但是,工作项目很可能最终会链接到许多变更集,并且我想查看作为工作项目一部分修改的文件,但我觉得如果我丢失一两个文件的可能性非常高必须依赖于单独查看 100 多个变更集中的每一个。

有谁知道有什么方法可以实现这一目标?预先感谢您的任何帮助或指导。

I'm trying to figure out a way to find out which files were affected by a work item in TFS 2008.

I realize that this is a duplication of a question already asked by someone else here - View a list of all files changed as part of a Workitem in TFS but it went unanswered and I've been, off and on, looking for this for a while.

I understand can view the links tab of the work item and then view each changeset to see the files that have been changed. But, the work item very likely will end up with many changesets linked to it, and I would like to review the files modified as part of the work item, but I feel like the likelihood of missing a file or two is very high if I have to rely on looking at each of the 100+ changesets individually.

Does anyone know of a way to accomplish this? Thanks in advance for any help or guidance.

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

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

发布评论

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

评论(3

心病无药医 2024-08-30 11:27:29

听起来像是 Powershell 的工作……

function Get-TfsItem([int] $workItemNumber)
{
    Get-TfsServer njtfs -all |
        foreach { $_.wit.GetWorkItem($workItemNumber) } |
        foreach { $_.Links } |
        foreach { ([regex]'vstfs:///VersionControl/Changeset/(\d+)').matches($_.LinkedArtifactUri) } |
        foreach { $_.groups[1].value } |
        Get-TfsChangeset | 
        Select-TfsItem |
        Sort Path -Unique 
}

前几行有点难看。我们必须直接访问 Web 服务 API,因为 TFS cmdlet 不涵盖错误跟踪系统。我们取回的对象需要一些正则表达式的爱,然后它们才会做我们需要的事情。通过管道传送到“foreach” over & over 是一个不幸的 Powershell 习语,当您将不友好的 API 与蹩脚的投影运算符配合使用时,就会出现这种情况。 (我个人使用我自己的替代品 ,但你不能依赖它。)

如果我的 TFS Power Cmdlet 已安装并已安装做他们的工作。

Sounds like a job for Powershell...

function Get-TfsItem([int] $workItemNumber)
{
    Get-TfsServer njtfs -all |
        foreach { $_.wit.GetWorkItem($workItemNumber) } |
        foreach { $_.Links } |
        foreach { ([regex]'vstfs:///VersionControl/Changeset/(\d+)').matches($_.LinkedArtifactUri) } |
        foreach { $_.groups[1].value } |
        Get-TfsChangeset | 
        Select-TfsItem |
        Sort Path -Unique 
}

The first several lines are kind of ugly. We have to hit the webservice API directly since the TFS cmdlets don't cover the bug tracking system. And the objects we get back require some regular expression love before they'll do what we need. Piping to "foreach" over & over is an unfortunate Powershell idiom that arises when you mate an unfriendly API to a lame projection operator. (I use my own replacement, personally, but you can't rely on that.)

The last 3 lines should be self explanatory if my TFS Power Cmdlets are installed & doing their job.

青丝拂面 2024-08-30 11:27:29

我刚刚找到了 VS 2010 的 Scrum Power Tools 插件,只需在 VSS 中单击按钮即可完成此操作,安装后即可运行。 http://visualstudiogallery.msdn.microsoft.com/3f261226-530e-4e9c -b7d7-451c2f77f262

我只是想让 powershell 版本 2010 工作。 http://msdn.microsoft.com/en-us/vstudio/bb980963

第一个问题是默认情况下未安装 pwoer shell 选项,请使用自定义安装并选择该选项。完成后,TFS powertools 2010 菜单中会出现一个 powershell 提示符,命令仅在此处起作用。

获取服务器我必须将 njtfs 替换为 url http://tfsserver:8080/tfs 并删除 -all。脚本仍然失败。

最终我需要一份详细报告,其中列出:
源“工作项”“更改集”

例如:

xyz.cs '工作项 1' 'C397'

xyz.cs '工作项 2' 'C399'

最终我必须弄清楚工作项 1 依赖于工作项 2。我还必须追溯到工作项 1 以检查状态。

有人可以帮忙制作2010版本的脚本吗?我以前从来没有写过PS。

I just found Scrum Power Tools plugin for VS 2010 that does this with a button click in VSS, installed and it worked. http://visualstudiogallery.msdn.microsoft.com/3f261226-530e-4e9c-b7d7-451c2f77f262

I am just trying to make the powershell version 2010 work. http://msdn.microsoft.com/en-us/vstudio/bb980963

First problem is that the pwoer shell option is not installed by default, use custom install and select that option. When completed there is a powershell prompt in the TFS powertools 2010 menu, the commands only work in there.

The get server I had to replace njtfs with the url http://tfsserver:8080/tfs and remove -all. The script still fails.

Ultimately I need a detail report that lists:
source 'work item' 'change set'

For example:

xyz.cs 'work item 1' 'C397'

xyz.cs 'work item 2' 'C399'

Eventually I have to then work out that work item 1 is dependant on work item 2. I also have to track back to work item 1 to check the status.

Can someone assist with a 2010 version script? I have never written PS before.

梅倚清风 2024-08-30 11:27:29

我需要完全相同的东西,所以我使用 TFS API 为自己编写了一个 TFS 实用程序。它允许您查看工作项随时间触发的所有更改,以及更多内容。我已经把它放在 codeplex 上了。您可以从以下位置获取:
tfshelper.codeplex.com

I needed the exact same thing and I wrote a TFS utility for myself, using TFS API. It allows you to see all changes a work item triggered over time, and some things more. I've put it on codeplex. You can get it from:
tfshelper.codeplex.com

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