3

Currently I have 2 branches - Development and Release.

Is it possible to obtain all unmerged changesets from Development to Release?

Currently we use the default Merge Wizzard. However it has one big limitation - it cannot filter by user. So I was thinking of building an app that will pull all unmerged changesets from Development to Release and allow me to filter those changesets by user.

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
Kiril Stanoev
  • 1,865
  • 2
  • 20
  • 33
  • possibly duplicate http://stackoverflow.com/questions/8121366/filtering-users-in-tfs-merge-wizard – Khh Nov 20 '11 at 12:39

2 Answers2

5

You could write a small console app that goes like this:

using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace UnmergedChangesets
{
    class Program
    {
        static void Main(string[] args)
        {
            TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://myserver:8080/collection"));
            VersionControlServer vcs = (VersionControlServer) tpc.GetService(typeof (VersionControlServer));
            MergeCandidate[] mergeCandidates = vcs.GetMergeCandidates("$/Development", "$/Release", RecursionType.Full);
        }
    }
}

This way you get into mergeCandidates all changesets that are missing in your Release branch.

If you want to further filter for a certain user you can do this with something like that:

foreach (var mergeCandidate in mergeCandidates)
{
  if(mergeCandidate.Changeset.Owner == @"DOMAIN\ChuckNorris")
  {
    //This is an unmerged changeset commited by Chuck 
  }
}
pantelif
  • 8,524
  • 2
  • 33
  • 48
1

Take a look at codeproject if you the standard windows doesn't fit your needs.

Somebody has done such a type of application so you can look how it works

TFS 2010 SDK: Smart Merge - Programmatically Create your own Merge Tool

Edit

I forgot, i work with this project template for VS2010

Visual Studio 2010 Project Template for TFS Utilities

Khh
  • 2,521
  • 1
  • 25
  • 42