views:

15

answers:

0

We'd like to generate build notes with the following format:

1) Associated ChangeSets:
2)   - ChangeSet 45241, by Joe: "Patching fix for foobar"
3)     'Foo.cs' integrated from dev v. 22 to qa v. 7
4)     'Bar.cs' integrated from dev v. 9 to qa v. 3

So far, we have a custom build step that accomplishes 1) and 2). It looks at the information produced by the 'AssociatedChangesetsAndWorkItems' TFS Build Activity. Here is the code:

protected override bool Execute(CodeActivityContext context)
{
     StreamWriter sw = new StreamWriter(Path.Combine(BuildNotesPath.Get(context),"build-notes.txt"));
     sw.WriteLine("Associated ChangSets:");
     foreach (Changeset changeset in BuildAssociatedChangesets.Get(context))
     {
        sw.WriteLine(string.Format("ChangeSet {0}, by {1}: {2}", changeset.ChangesetId, changeset.Committer, changeset.Comment));            
        foreach (Change change in changeset.Changes)
        {               
           foreach (MergeSource source in change.MergeSources)
              sw.WriteLine(string.Format("\'t{0}': integrated from dev v. {1} to qa v. {2}", source.ServerItem, source.VersionFrom, source.VersionTo));
        }
     }
     sw.Flush();
     sw.Dispose();
     return true;  
}

The problem we're having is that the 'MergeSources' field is always an empty list. What do we have to do to get that field populated?