Answered Report ChangeSet Details

  • Friday, July 28, 2006 7:32 PM
     
     

    I need to create a few reports containing the details of Changesets. 

    1. I want to report the same info that appears in the "Details for Changeser#<SetNumber> - SourceFiles  What is the query to do that?
    2. What is the source for the stored procedure "prc_QueryChangeSet" - Can I safely use this stored procedure (i.e. without corrupting the data?)

    3. How can I get a list of all files in all unmerged changesets, grouped by changesets?


    Thanks in advance!

     

    Doug Barker

    www.cooltimbers.com

    "Art for your soul."

     

     

All Replies

  • Saturday, July 29, 2006 7:13 AM
    Moderator
     
     
    Doug,

    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 PM
    Moderator
     
     Answered

    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.