一种在TFS 2008中找出一个workItem或一组chgset的所有受影响文件的方法? [英] A way to find out all affected files of a workItem or group of chgsets in TFS 2008?

查看:107
本文介绍了一种在TFS 2008中找出一个workItem或一组chgset的所有受影响文件的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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.

推荐答案

听起来像Powershell的工作...

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 
}

前几行很丑.由于TFS cmdlet不涵盖错误跟踪系统,因此我们必须直接使用Webservice API.而我们取回的对象在完成我们需要的操作之前,需要一定的正则表达式爱.通过管道"foreach"当您将不友好的API与a脚的投影运算符配对时,就会出现一个不幸的Powershell习惯用法. (我个人使用我自己的替代物 ,但您不能依靠它.)

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.)

如果我的 TFS Power Cmdlet,最后三行应该可以自我解释 a>已安装&做他们的工作.

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

这篇关于一种在TFS 2008中找出一个workItem或一组chgset的所有受影响文件的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆