如何创建移动 tfs 分支的脚本?
我正在尝试创建一个脚本,将功能分支移动到存档区域。该脚本如下所示:
mkdir C:\TempWorkspace
pushd C:\TempWorkspace
tf workspace /new /noprompt /s:http://rdsw02fdkserv:8080/tfs MoveToArchive
tf workfold /unmap $/ /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /map "$/Fusion Server/Development/%1" C:\TempWorkspace\%1 /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /map "$/Fusion Server/Development/Archive" C:\TempWorkspace\Archive /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf move "$/Fusion Server/Development/%1" "$/Fusion Server/Development/Archive/%1"
tf checkin /comment:"Move %1 to archive"
tf workfold /unmap "$/Fusion Server/Development/%1" /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /unmap "$/Fusion Server/Development/Archive" /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workspace /delete /noprompt MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
popd
del C:\TempWorkspace /q /f
执行移动时出现以下错误:
TF14097:当分配了工作文件夹映射时,无法重命名 $/Fusion Server/Development/B-01560。
这可以做到吗?
解决方案:
mkdir C:\TempWorkspace
pushd C:\TempWorkspace
tf workspace /new /noprompt /s:http://rdsw02fdkserv:8080/tfs MoveToArchive
tf workfold /unmap $/ /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /map "$/Fusion Server/Development/" C:\TempWorkspace\ /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf get .
tf move "$/Fusion Server/Development/%1" "$/Fusion Server/Development/Archive/%1"
tf checkin /comment:"Move %1 to archive"
tf workfold /unmap "$/Fusion Server/Development" /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workspace /delete /noprompt MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
popd
del C:\TempWorkspace /q /f
I'm trying to create a script that will move a feature branch to an archive area. The script looks like this:
mkdir C:\TempWorkspace
pushd C:\TempWorkspace
tf workspace /new /noprompt /s:http://rdsw02fdkserv:8080/tfs MoveToArchive
tf workfold /unmap $/ /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /map "$/Fusion Server/Development/%1" C:\TempWorkspace\%1 /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /map "$/Fusion Server/Development/Archive" C:\TempWorkspace\Archive /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf move "$/Fusion Server/Development/%1" "$/Fusion Server/Development/Archive/%1"
tf checkin /comment:"Move %1 to archive"
tf workfold /unmap "$/Fusion Server/Development/%1" /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /unmap "$/Fusion Server/Development/Archive" /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workspace /delete /noprompt MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
popd
del C:\TempWorkspace /q /f
I get the following error when the move is performed:
TF14097: Cannot rename $/Fusion Server/Development/B-01560 when it has a working folder mapping assigned to it.
How can this be done?
Solution:
mkdir C:\TempWorkspace
pushd C:\TempWorkspace
tf workspace /new /noprompt /s:http://rdsw02fdkserv:8080/tfs MoveToArchive
tf workfold /unmap $/ /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workfold /map "$/Fusion Server/Development/" C:\TempWorkspace\ /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf get .
tf move "$/Fusion Server/Development/%1" "$/Fusion Server/Development/Archive/%1"
tf checkin /comment:"Move %1 to archive"
tf workfold /unmap "$/Fusion Server/Development" /workspace:MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
tf workspace /delete /noprompt MoveToArchive /s:http://rdsw02fdkserv:8080/tfs
popd
del C:\TempWorkspace /q /f
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法重命名分配有工作文件夹映射的文件夹。即,如果您有从 $/A 到 C:\A 的映射,则无法重命名 $/A。相反,取消映射 $/A 并为其父 $/ 创建映射,然后您可以将 $/A 重命名为 $/B。
You can't rename a folder that has working folder mappings assigned to it. Ie, if you have a mapping from $/A to C:\A, you cannot rename $/A. Instead, unmap $/A and create a mapping for its parent $/, then you can rename $/A to $/B.