Unable to determine the workspace
I am executing the below command line implementation as .bat file. I am getting "Unable to determine the workspace" while getting the latest version.
IF NOT EXIST C:\TFSGet MD C:\TFSGet
tf workspace /delete ws1 /noprompt /s:s1 /login:j,j1
tf workspace /new /s:s1 ws1 /noprompt /login:j,j1
tf workfold /s:s1 /workspace:ws1 /unmap $/
tf workfold /server:s1 /workspace:ws1 /map $/x/y/z/customer/9 C:\TFSGet
tf get /recursive /noprompt
echo getting files
echo finished
The 'get' command in tf.exe attempts to automatically determine the workspace which it should operate on. For this to work correctly there can only be one workspace with a local path mapped at or below the directory in which the get is performed. So you have two possible solutions to your problem:
1. Make sure there is only one workspace with a mapping anywhere on the C: drive
2. (The more appropriate solution) Have your script perform a 'cd c:\tfsget' before performing the get.
Let me know if this doesn't work out for you.
Patrick
Yes, I am using more than one workspace in my system. The first one is default workspace and the another one i am creating through script.
OK... Please let me know solution for handling more that one workspace?
AJS
Try:
IF NOT EXIST C:\TFSGet MD C:\TFSGet
tf workspace /delete ws1 /noprompt /s:s1 /login:j,j1
tf workspace /new /s:s1 ws1 /noprompt /login:j,j1
tf workfold /s:s1 /workspace:ws1 /unmap $/
tf workfold /server:s1 /workspace:ws1 /map $/x/y/z/customer/9 C:\TFSGet
pushd C:\TFSGet
tf get /recursive /noprompt
echo getting files
echo finished
This should do the trick.
-Aaron