Folks,
I am trying to unshelve and then download a single file using TF.exe command line utility. But i keep facing problems.
This is being done from teamcity interface. There a better way of doing this ?
To unshelve
if "%ShelvesetName%"=="" exit /b 0
"D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" workspaces /server:%tfscollection% /owner:%uDeploy_Username%
"D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" unshelve "%ShelvesetName%" /recursive /noprompt /login:%uDeploy_Username%,%tfspassword%
To get a single file from a different Root url in TFS
"D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" workspaces /server:%tfscollection% /owner:%uDeploy_Username%
"D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" workfold /map "%TFS_BRANCH_SPECIAL%" "%wspath%"
"D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" get /v:LnewLabel
If you want to unshelve to a different location/branch. You could try to use tfs power tools.
Define your path in cmd with the TFPT. And then, from there, you go to the destination folder or workspace where you want to unshelve your code.
1. c:\>path = %path%;C:\Program Files (x86)\Microsoft Team Foundation Server 201x Power Tools
2. cd c:\[some location]\"destination workspace"
3. tfpt unshelve /migrate /source:"$/ProjectName/Branch" /target:"$/ProjectName/Targetbranch" "My Shelveset Name"
If you want to download to an different local workspace, just unshelve it to the corresponding sever path/branch, then download the branch from server to local workspace.
More details you can refer this blog: Move Shelveset to a Different Branch in TFS