Export TFS 2010 History to Excel or Text Document

前端 未结 5 1511
忘掉有多难
忘掉有多难 2020-12-28 16:24

How do you export history from TFS 2010 that includes the user, date and the complete comment (not truncated)?

For example, in Team Explorer: right-click team member

5条回答
  •  我在风中等你
    2020-12-28 16:39

    The easiest way is to connect to the TFSWharehouse from excel, then pull the data from the source control history in a excel sheet. This is really simple and very powerful.

    You'll find useful info here: http://www.woodwardweb.com/vsts/getting_started.html

    Edit:

    Using the TFS API to enumerate the changesets when you don't have access to SSAS (e.g. tfspreview.com for instance):

    TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, true);
    tpp.ShowDialog();
    
    var tpc = tpp.SelectedTeamProjectCollection;
    
    VersionControlServer versionControl = tpc.GetService();
    
    var tp = versionControl.GetTeamProject("MyTeamProject");
    var path = tp.ServerItem;
    
    var q = versionControl.QueryHistory(path, VersionSpec.Latest, 0, RecursionType.Full, null, new ChangesetVersionSpec(1), VersionSpec.Latest, Int32.MaxValue, false, true, false, false);
    
    foreach (Changeset cs in q)
    {
        var user = cs.Owner;
        var comment = cs.Comment;
        var date = cs.CreationDate;
    
        Debug.WriteLine(string.Format("[{3}] Date: {0}, User: {1}, Comment {2}", date, user, comment, cs.ChangesetId));
    }
    

提交回复
热议问题