0

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?

L4c0573
  • 333
  • 1
  • 7
  • 23
  • 1
    Are you dealing with a solution with over 100 projects? How long does it take? The reason I ask is because working with very large projects DOES take a long time. There is no magic fix, ok there is one, MS are working on a Virtual Git to manage the 50 million lines of Windows OS. – Jeremy Thompson Feb 06 '18 at 06:51
  • The folder on which I want to perform a get-latest only consists of one solution which includes two projects and some .xml and .ps1 files. Ok it´s size is about 350MB. But if the get-latest process needs much time that´s okay for me. I only want to find a way to check if an get-latest is necessary at all. So that I don´t have to execute an get-latest when it´s not necessary. I´ve used the stopwatch class to measure the execution time. The get with preview took 13 sec., the get-latest took 10sec. – L4c0573 Feb 06 '18 at 08:48

1 Answers1

1

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.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187