Merged Changesets List

(#Reporting forum asked me to start a thread about this topic in this forum. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=767423&SiteID=1 )

Hi All,

I am trying to get a report that would tell me what changesets that were merged. For example, I merge 10 changesets from my Dev line to my Test line and then commit the merge by checking it it. This would create 1 changeset coz of the checkin and the merge operation is complete.
Now, can I generate a report that tells me what 10 changesets went in to the Test line.

Any suggestions?

[566 byte] By [GS] at [2007-12-24]
# 1
Robert Horvick wrote a great series of blog posts about this topic. See: http://blogs.msdn.com/roberthorvick/archive/2006/02.aspx
RichardBergMSFT at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 2

Hello,

I suggest you have a look at History Sidekick; the application displays all performed merges history. Though the functionality is available on per item (file/folder) basis, it may help you in some cases.

Regards, Eugene

eugene.z at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 3
I checked History sidekick which is nothing but a UI version of code Richard wrote in this thread: http://72.14.207.104/search?q=cache:aB7gclENrr8J:forums.microsoft.com/MSDN/ShowPost.aspx%3FPostID%3D591475%26SiteID%3D1+GetMergeCandidates&hl=en&gl=us&ct=clnk&cd=7
I modified the code a little to get some more info:
class Program
{
static void Main(string[] args)
{
TeamFoundationServer tfs = new TeamFoundationServer("myserver");
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("$/WItest3/All Products-Test Line", "$/WItest3/ClassLibrary1-Dev", RecursionType.Full))
{
Changeset cs = vc.GetChangeset(mc.Changeset.ChangesetId);
Console.WriteLine("ChangesetId: " + mc.Changeset.ChangesetId);
if (cs.Changes != null)
{
if (cs.Changes.Length > 0)
{
for (int k = 0; k <= cs.Changes.Length - 1; k++)
{
Console.WriteLine("CHANGE ITEM: " + cs.Changes[k].Item);
Console.WriteLine("CHANGE TYPE: " + cs.Changes[k].ChangeType);
}
}
}
Console.WriteLine(cs.Changes.ToString());
if(cs.CheckinNote != null)
Console.WriteLine("Checkin Notes: " + cs.CheckinNote.ToString());
if(cs.Comment != null)
Console.WriteLine("Comment: " + cs.Comment.ToString());
Console.WriteLine("Committer: " + cs.Committer.ToString());
Console.WriteLine("Creation Date: " + cs.CreationDate.ToString());
Console.WriteLine("Owner: " + cs.Owner.ToString());
Console.WriteLine("Policy Override: " + cs.PolicyOverride.ToString());
if (cs.WorkItems != null)
{
if (cs.WorkItems.Length > 0)
{
for (int j = 0; j <= cs.WorkItems.Length-1; j++)
{
Console.WriteLine("Work Item: " + cs.WorkItems[j].Id);
Console.WriteLine("Work Item Title: " + cs.WorkItems[j].Title);
}
}
}
Console.WriteLine("--");
}
Console.ReadLine();
}
}
THE ISSUE WITH THIS CODE is it only tells us the resulting changeset. to explain little more, it tells me the merged changeset in the branch but it doesn't tell me what all changesets(i.e. those 10 changesets of the source branch) that it commited to create that resulting changeset.

Although, I think Robert Horvick's work inhttp://blogs.msdn.com/roberthorvick/archive/2006/02.aspx
is something very close to what i am looking for.
But the problem is that his post is in very very raw form. he did a great job in figuring out but did not present it very well. Combining all his posts on merging and then making that code complie is a huge task itself.

GS at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 4
If you are willing to install the SP1 beta, there's a new API function called QueryMergesWithDetails that returns individual files instead of changesets. That removes most of the complexity from Robert's efforts.

As for UIs, there's a new one being demoed here that you might want to try: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=754566&SiteID=1

RichardBergMSFT at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 5

Hello,

You original question was about past merges history whereas merge candidates give you the information about possible merges that may be performed. And you are right about Sidekick - it is UI for methods existing in object model and it provides both past merge history and possible merge candidates for selected file/folder. What you require is changeset based queries, and I do not think there is tool that readily provides that information. You might want to write one as a service to the community ;)

The tool Richard mentioned also will give you file and not changeset specific information.

Regards, Eugene

eugene.z at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...

Visual Studio Team System

Site Classified