I can query PendingSets and candidate PendingSets, and there appears to be no way to tell between included pending changes, and excluded pending changes.
I have one file included in the included changes to check in via Visual Studio Team Explorer.
Using Tfs dlls to query I get that there are 112 pending, and 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();
The 112 value does line up with included+excluded. The 465 value lines up with the Detected add(s) value.
However I've been completely unable to figure out which changes are currently included. I've tried Tfs dll querying, and EnvDte
for hours.
Can I programatically get the list of included changes currently (and even better, change the include/exclude list) ?