Check if all files in TFS folder are "latest"

99 Views Asked by At

I´d like to check if all files in an specific tfs folder are "latest". If they are not (see picture) a get-latest will be executed. If they are all "latest" no get-latest will be performed. The reason why I´d like to prevent always executing a get-latest is that it takes much time.

enter image description here

So what I need to know is whether all files are latest. I tried to get this information that way. Getting the latest-state worked well, but it took even more time than an get-latest itself.

Is there any way to get information about the latest-state of files hostet in tfs, without performing time-consuming operations?

1

There are 1 best solutions below

0
Edward Thomson On BEST ANSWER

If you want to know whether you're up-to-date without downloading files, then you can do a "preview get":

tf get /version:T /preview

This will tell you whether you're up-to-date or not, and if not, what you would need to download to become up-to-date.

But this strategy will not provide a benefit for speeding up your updates, it will be (net) slower than if you'd just done a get latest in the first place.

Get Latest (with preview) will ask the server what's necessary to do a get: the server will compute the differences between your workstation version and the server version and provide you with the list of files that you need to download.

Now if you were to turn around and do a Get Latest, then that will... ask the server what's necessary to do a get. It will recompute that list, and give you the list of files that you need to download. Now you'll actually download them and "complete" the Get by telling the server that you've updated your local files.

You've added an unnecessary round-trip and server computation to the mix.

Doing a "Get Latest" is the fastest possible route to updating your latest version information, whether you're already up-to-date or not.