问题
I'm redesigning a control that lists the contents (files and folders) under a given TFS path. The tricky part is that I don't want to create a workspace for achieving this, as my intention is just to list the contents and display the history of a selected item. The current implementation creates a local workspace mapping in the background to achieve this, is this needed? Can I attain this without a local workspace mapping?
Thanks Joe.
回答1:
Use GetItems, which does not require a workspace. For example:
TeamFoundationServer tfs = new TeamFoundationServer("http://tfs:8080/tfs/DefaultCollection");
VersionControlServer versionControl = tfs.GetService<VersionControlServer>();
ItemSet items = versionControl.GetItems(tfsPath, RecursionType.Full);
来源:https://stackoverflow.com/questions/26505190/list-source-control-files-and-folder-under-a-given-tfs-path-without-work-space