Report ChangeSet Details
-
Friday, July 28, 2006 7:32 PM
I need to create a few reports containing the details of Changesets.
- I want to report the same info that appears in the "Details for Changeser#<SetNumber> - SourceFiles What is the query to do that?
-
What is the source for the stored procedure "prc_QueryChangeSet" - Can I safely use this stored procedure (i.e. without corrupting the data?)
-
How can I get a list of all files in all unmerged changesets, grouped by changesets?
Thanks in advance!Doug Barker
"Art for your soul."
All Replies
-
Saturday, July 29, 2006 7:13 AMModeratorDoug,
Are you trying to use the OLAP cube, or build a custom app? If the former, try asking in the TFS Reporting forum. If the latter, use the client object model's TeamFoundationServer.QueryChangeset() for #1 and Workspace.Merge() with the candidate parameter for #3.
[standard disclaimer that I'm not at work and may have remembered the function names slightly wrong] -
Tuesday, August 01, 2006 8:44 PMModerator
Direct database access (#2) is never supported. Here's more complete info on #1 and #3:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
TeamFoundationServer tfs = new TeamFoundationServer("server");
VersionControlServer vc = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
// changeset info
Changeset cs = vc.GetChangeset(1234);
Console.WriteLine(cs.ToString());
// files in unmerged changesets
foreach (MergeCandidate mc in vc.GetMergeCandidates("$/project/sourceBranch", "$/project/targetBranch", RecursionType.Full))
{
foreach (Change change in mc.Changeset.Changes)
{
Console.WriteLine(change.Item.ToString());
}
}
}
}
}
Code is untested, usual disclaimers apply, etc.

