index > Team Foundation Server - Version Control > Merged Changesets List

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

G S
Robert Horvick wrote a great series of blog posts about this topic. See: http://blogs.msdn.com/roberthorvick/archive/2006/02.aspx
Richard Berg MSFT

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




Blog at http://teamfoundation.blogspot.com
eugene.z
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 in http://blogs.msdn.com/roberthorvick/archive/2006/02.aspx
G S
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
Richard Berg MSFT

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




Blog at http://teamfoundation.blogspot.com
eugene.z
reply 6

You can use google to search for other answers

 

More Articles

Generate list of merge conflict
Re: Check-out not getting latest (RTM)
WScript.Exec + tf get /all hangs?
VC programming help needed
Migrating TFS workspace from TFS Server A to TFS Server B, is thi...
TF14087: Cannot undelete...because not all of the deletion is bei...
regarding locking in tfs
Creation of Non-Source / Empty Projects
Checking in Enterprise Library
Eval Copy
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Get latest from TFS - Need add in
TFS proxy in two differnt domains
Feature request - Check in approvals
Problem checking solution into TFS - Uns…
Team Foundations Server and VS2003
RE: Checkin a project into VSS 2005
Stored Procedure Source Control
Check out files status
Subfolder overwrite issue in Team System…
No straight forward way to get list of f…
Adding existing Web Application - Local …
TF53010
Undo add of solution/project
Source branching questionnaire
Why is the "Compare" item disa…

Hot Articles

Migrate sourcegear vault to TFS?
Merging work-items
Date Recreation in VC Migration
Middle tier caching - Is it available? (…
Changing Permissions on New Branches
Restrict access to all top level folders…
Merge / commit not committing all pendin…
Source Code Footer
Workspace.PendAdd, the EnvDTE and "…
Setting TFS SC through code
get lastest problem (didn't get all file)
WScript.Exec + tf get /all hangs?
Merge, Rollback issue
How do I / Can I list files within a Cha…
MSSCCI provider causes VC6 crash

Recommend Articles

Compare between folders
newbie questions regarding permissions i…
Workspace cache for non .net developers
Compare between 2 label
"Keep checked out" on check-in
BizTalk 2006 and Team Foundation Server …
Solution with multiple projects can't pe…
TF Workspace command-line
Team System add-on for SQL 2005 Manageme…
Binding trouble when migrating VS2003 So…
Version control under SQL 2005
Version control API - basic recipes
Add arbitrary files and folders to sourc…
Import non-VSS solution and projects?
"retiring" or locking a branch…