我可以查询 PendingSets 和候选 PendingSets,并且似乎无法区分包含的挂起更改和排除的挂起更改。
我在包含的更改中包含一个文件,可以通过 Visual Studio 团队资源管理器签入。
使用 Tfs dll 查询,我得到有 112 个待处理的,和 145 个 CandidatePending:
var tfsServer = Macros.TfsModule.GetTfsServerFromEnvironment();
var tfs =new Macros.TFS(tfsServer,"Development", null);
var vcs= tfs.Tfs.GetService<Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer>();
var searchBase=vcs.GetItem("$/");
//vcs.Dump();
var workspace = vcs.GetWorkspace(Environment.ExpandEnvironmentVariables("%devroot%"));
// vcs.QueryWorkspaces(null,null,null).Dump("workspaces");
var itemSpecs = new []{new ItemSpec(searchBase.ServerItem,RecursionType.Full)};
vcs.QueryPendingSets(itemSpecs, workspace.Name, workspace.OwnerName, false, true)
.Select(ps=>new {Pending=ps.PendingChanges.Select(pc=>new{ pc.LocalOrServerItem,PendingChange=Util.OnDemand("PendingChange",()=> pc)}), ps.CandidatePendingChanges})
.First()
.Dump();
workspace.Dump();
112 值确实与“包含+排除”一致。 465 值与检测到的添加值一致。
但是我完全无法弄清楚当前包含哪些更改。我尝试过 Tfs dll 查询,并且EnvDte
用了几个小时。
我可以通过编程方式获取当前包含的更改列表(更好的是,更改包含/排除列表)?