Search code examples
c#tfstfs-sdk

is there a way to get the file names which need to be updated if TFS status.Numoperations != 0?


I have a piece of code which looks at the status of a workspace, something like below.

var status = workspace.Get(request, GetOptions.Preview).NumOperations;

if status is greater than zero I want to know the names of or the complete path of files on which the get operation will be performed. i plan on doing a selective get after getting the list of files.

is this possible?


Solution

  • You have to query the changesets between your local workspace and server and then parse the changed files in the changeset.

    Use VersionControlServer.QueryHistory() to get the chanages:

    var changes = vcs.QueryHistory("$/ServerPath", VersionSpec.Latest, 0, RecursionType.Full, null, new WorkspaceVersionSpec(localworkspace),null,Int32.MaxValue,true,true);