Reputation: 3145
Given a Team Foundation Server repository, how can I retrieve all checked in versions (or versions later than a specific changeset) of a specific file?
The reason I'm asking is I want to track what versions contain a certain string. So I thought I'd download them all and then grep or similar.
Upvotes: 1
Views: 406
Reputation: 114461
There is no standard way to do it from the UI or the commandline, but it's easy to do from the Client Object Model.
You can use the VersionControlServer.DownloadFile
method and supply a versionspec. And you can use the VersionControlServer.QueryHistory
method to query all the different changeset versions of the file.
Combined you'd be able to piece together a small Console application or a Powershell script to grab all versions. And grep them at the same time by adding a bit of Regex :).
Check out this blog post to see how to connect to TFS and get hold of the ProjectCollection from which you can request the VersionControlServer
object.
Upvotes: 4