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]
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 >
