无法使用 TF.exe 确定工作区 [英] Unable to determine the workspace using TF.exe

查看:96
本文介绍了无法使用 TF.exe 确定工作区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个脚本(bat文件)

I have this script (bat file)

tf workspaces /s:http://project02:8080

tf workspace /s:http://project02:8080 Team.descomp;MyDomain\Myuser


tf workfold /workspace:Team.descomp


tf get $/Team/Main/Projects /recursive /force /noprompt

我收到此错误:无法确定工作区.当我尝试执行 tf get 时.

I get this error: Unable to determine the workspace., when I try execute tf get.

控制台输出类似于:

服务器:project02

Server: project02

工作区:DESCOMP

Workspace: DESCOMP

所有者:我的用户

计算机:DESCOMP

Computer : DESCOMP

工作区:Team.descomp

Workspace: Team.descomp

所有者:我的用户

计算机:DESCOMP

Computer : DESCOMP

...

工作区:Team.descomp (MyUser)

Workspace: Team.descomp (MyUser)

服务器:http://project02:8080/

$/团队:C:\Temp\Team2

$/Team: C:\Temp\Team2

...

无法确定工作区.

注意,对于 $/Team(团队项目)在两台机器上有地图:MyUser 和 Descomp

Note, for $/Team (team project) has map in two machines: MyUser and Descomp

工作区:团队所有者:MyUser计算机:我的用户

Workspace: Team Owner : MyUser Computer : MyUser

工作区:Team.descomp 所有者:我的用户计算机:DESCOMP

Workspace: Team.descomp Owner : MyUser Computer : DESCOMP

有什么建议吗?

推荐答案

来自论坛 MSDN:霍夫曼先生

From Forums MSDN: Mr. Hofman

http://social.msdn.microsoft.com/Forums/en/tfsbuild/thread/82b13bfd-5fd7-45f7-a681-d84c9ea52765

将 tf get 的工作文件夹更改为工作区映射的文件夹.

Change the working folder for the tf get to a folder that is mapped by the workspace.

从映射工作区的文件夹执行命令

Execute the command from a folder where the workspace is mapped

(例如,如果您从控制台执行此操作:

(for example if you do it from console:

cd c:\sources\myteamproject

tf get ...

)

关键:将 tf get 的工作文件夹更改为工作区映射的文件夹.

Key: Change the working folder for the tf get to a folder that is mapped by the workspace.

我在脚本文件中使用命令 pushd C:\Temp\Team2.

I use command pushd C:\Temp\Team2 in my script file.

更新:Ryan Cromwell 的评论

Update: Comments by Ryan Cromwell

您可以使用以下内容在脚本中创建和映射工作区.第二个命令有效,因为第一个工作区是在blah"文件夹中创建的.这 '.'在第二个命令中说将$/"映射到当前目录(等等).如果您愿意,您可以将其更改为命名文件夹或子文件夹.

You can create and map a workspace in your script with the following. The second command works, because the first workspace is created in the 'blah' folder. The '.' in the second command is saying map '$/' to the current directory (blah). You could change that to be a named folder or subfolder if you choose.

创建新工作区
C:\projects\blah>tf workspace/new blah/noprompt/collection:http://:/tfs//login:<用户名>,<密码>

映射该工作区中的路径
C:\projects\blah>tf workfold/map $/./login:<用户名>,<密码>

这篇关于无法使用 TF.exe 确定工作区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆