antwarpes
antwarpes

Reputation: 2277

"tf get" from command line doesn't get latest, UI does

Did I get the syntax correct?

  tf get .\Web\project.root /recursive
  All files are up to date.


  tf get /version:T .\Web\project.root /recursive
  All files are up to date.

Getting latest using the command line will report that all files are up to date when they are not! However, when I get latest using the TFS UI within Visual Studio, the latest code does actually download.

Until this gets resolves, my super fancy msbuild script can't be used without opening visual studio to get latest first!!

  <Target Name="GetLatestCoreLibraries" Condition="'$(GetLatest)' == 'true'">
    <Exec Command='tf get /version:T "$(CoreLibPath)\Source\Libraries /recursive' ContinueOnError="false" />
  </Target>

The $(CoreLibPath) is a relative path passed into the script. Something like...

  <PropertyGroup>
    <CoreLibraryPath>..\..\Core\Release\xx.xx.xx.xx</CoreLibraryPath>
  </PropertyGroup

Is using relative paths to the local file system less reliable than using SCS paths? ie... $/Core/Release/xx.xx.xx.xx/Source/Libraries"?

Could it be that we're sometimes using Dev Studio UI, and other times using the command line that is confusing the command line version of TFS?

Upvotes: 4

Views: 6843

Answers (3)

Matt Elliott
Matt Elliott

Reputation: 1

Another option is that the user does not have access to the project collection. In my case I could somehow see the directories but did not have access to pull down the code. I had to have a TFS admin add me as "developer" access.

Upvotes: 0

antwarpes
antwarpes

Reputation: 2277

So, I realized my mistake. It was very simple.

Command = 

    'tf get
       /version:T 
       /recursive
       "$(CoreLibPath)\Source\Libraries <<<-- Missing closing quote.
     '

When you miss the closing double quote on a tf get, there is no error thrown. It simply reports that "All files are up to date."

c:\Web\Release\x.x\x.x.xxxx>tf get /version:T "..\..\..\..\..\Core\Release\x.x\x.x.xxxx.xxxxx(xxxx xx xx - xxx)\Source\Libraries /recursive
All files are up to date.

Q: Is using relative paths to the local file system less reliable than using SCS paths? ie... $/Core/Release/xx.xx.xx.xx/Source/Libraries"?

A: No, it doesn't seem to be any less reliable.

Q: Could it be that we're sometimes using Dev Studio UI, and other times using the command line that is confusing the command line version of TFS?

A: No, this was a case of user confusion, not SCS confusion.

Upvotes: 3

DaveE
DaveE

Reputation: 3627

Try using the /force parameter. That'll force everything to be retrieved, which maybe you don't want.

Alternatively you could get the MSBuild Extension Pack from CodePlex - they have MSBuild tasks that wrap these calls and work with IntelliSense if you're using Visual Studio to manage your build scripts.

Your itemspec looks odd to me, but I don't have any specific corrections to offer. I explicitly call out the workspace when using command line calls, e.g. tf get "$/<our product>/<branch>[/<project>]" /force /recursive. Otherwise pathing is relative to the current active workspace mapping.

Upvotes: 2

Related Questions