如何创建移动 tfs 分支的脚本?

发布于 2024-11-06 16:15:20 字数 1861 浏览 0 评论 0原文

我正在尝试创建一个脚本,将功能分支移动到存档区域。该脚本如下所示:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千纸鹤 2024-11-13 16:15:20

您无法重命名分配有工作文件夹映射的文件夹。即,如果您有从 $/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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文