2014-12-04 65 views
0

我使用VS 2012,Microsoft.TeamFoundation.Client.dll 11.0(TFS API)和服務器TFS 2008在TFS API(TFS 2008,VS 2012)中獲取分支和合並歷史記錄

我已創建分公司

int changesetId = vcServer.CreateBranch(sourcePath, targetPath, VersionSpec.Latest); 
Changeset changeset = vcServer.GetChangeset(changesetId); 
      changeset.Comment = comment; 
      changeset.Update(); 

我可以變更集列表

 var ChangesetList = vcServer.QueryHistory(targetPath, 
       VersionSpec.Latest, 0, RecursionType.Full, "", versionFrom, VersionSpec.Latest, 
       Int32.MaxValue, 
       true, // the boolean "include changes" is taking the time... If you do not include the changes and only the metadata of the changesets the query is very fast 
       false).Cast<Changeset>(); 

我可以做結帳和簽入關於分公司的文件,然後執行合併。

我很困惑如何獲取關於分支機構歷史(GetBranchHistory)的好信息,合併歷史記錄(可能是QueryMergesWithDetails),以及與QueryPendingSets的差異。

回答

1

我覺得老了,老的博客文章由羅伯特可以幫助你 http://blogs.msdn.com/b/roberthorvick/archive/2006/02/04/524960.aspx 如果沒記錯,我們在2010年加入TFS更好的API,支持更強大的註釋和分支可視化。 至於QueryPendingSets,它與分支歷史記錄無關。它爲您提供了可能的服務器上未決更改集。你也可以嘗試Workspace.GetPendingChanges,但我需要知道具體的幫助:)