English 中文(简体)
将所有文件夹在册
原标题:listing all contents of a folder in tfs

Given a particular path of folder in tfs, I need to recursively find all files and folders within the folder for a given changeset. In other words, i need to get the transitive closure of a path in tfs for a given changeset. The problem I m facing in doing so is listing the contents of a particular folder within tfs.. How would this be possible in C# ?

最佳回答

我假定,你想要的是X号改动内容的倍数,而不是X号改动内容的倍数。

情况是正确的使用要求,只是通过一个版本,预示着大家对变化的兴趣。

http://msdn.microsoft.com/en-US/library/bb138911.aspx

因此,假定你已经提到《ControlServer案》:

var myFolderAtChangeset17 = versionControlServer.GetItems("$/MyFolder", new ChangesetVersionSpec(17), RecursionType.Full);

如果I misunderstood和你真的想把构成第X号修改内容的内容相提并论,就会有几种不同的方式来做,而是用

问题回答

与此类似,或许是你所期待的。 这带来了变化,并通过这些变化加以调整,确定了特定道路上的变化。 这可以缩短,但我会说,这比我大想说的话更小一点:

    TeamFoundationServer tfs = new TeamFoundationServer("http://tfs:8080");
    VersionControlServer vcs = tfs.GetService<VersionControlServer>();

    Changeset cs = vcs.GetChangeset(6284868);

    foreach (Change change in cs.Changes)
    {
        if (change.Item.ServerItem.StartsWith("$/Application Common/Dev/src"))
        {
            System.Diagnostics.Debug.WriteLine(string.Format("Changeset {0}, file {1}, changes {2}",
                cs.ChangesetId, change.Item.ServerItem, change.ChangeType.ToString()));
        }
    }

我认为,这样做会奏效。


    TeamFoundationServer tfs = new TeamFoundationServer("http://tfs:8080");   
    VersionControlServer vcs = tfs.GetService();   
    ItemSet items;

    items = vcs.GetItems(tfsPath, RecursionType.Full);

如果你有其他想法,请说明这些想法。

您可以利用网络服务获取包含所有改动内容的XML文件。 然后,只是通过变品清单,看看它们是否在你寻找的道路上。

The URL to the changeet webservice:

http://your_tfs_server /VersionControl/Changeset.aspx?artifactMoniker=your_changeset_ Nos&webView=true





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签