gpt4 book ai didi

tfs - 在TFS中如何填充Change.MergeSources字段?

转载 作者:行者123 更新时间:2023-12-02 04:13:53 25 4
gpt4 key购买 nike

我们要生成以下格式的构建说明:

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

到目前为止,我们已经完成了1)和2)的自定义构建步骤。它查看由“AssociatedChangesetsAndWorkItems” TFS生成 Activity 产生的信息。这是代码:
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;
}

我们遇到的问题是“MergeSources”字段始终为空列表。我们要怎么做才能填充该字段?

最佳答案

查看MergeWorkItemsEventHandler.MergeWorkItems.GetMergeHistory以及Extensions.PendingMerges中的TFS 2010 Merge Work Items Event Handler方法,以获取合并源的示例。

Jakob Enh deserves the credit给出了答案。 :)

关于tfs - 在TFS中如何填充Change.MergeSources字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3772674/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com