Question

In Team Foundation, you can ask Team Explorer to show deleted files by doing this:

Tools > Options > Source Control > Visual Team Foundation Server > Show deleted items in the Source Control Explorer.

My question is how do you do the same thing programmatically?

I am developing a synchronisation tool, and I need to detected deleted files in TFS. Workspace.Get(...) returns only non-deleted files.

Any idea how I can achieve that?

Was it helpful?

Solution

Go to the Visual Studio folder in your start menu and start up a Visual Studio Command Prompt from the "Visual Studio Tools" subfolder.

The command you want to run is:

tf dir /server:myserver $/myproject /recursive /deleted

(where myserver and myproject are your server and project)

use "tf help" for general info, "tfs help dir" for more help on this command, or google on "tf.exe" for more info.

OTHER TIPS

The VersionControlServer.QueryHistory API will give you access to the changesets which will contain all version control operations including deletes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top