Я пытаюсь создать скрипт, который будет перемещать ветвь объектов в область архива.Сценарий выглядит следующим образом:
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: Cannot rename $/Fusion Server/Development/B-01560 when it has a working folder mapping assigned to it.
Как это можно сделать?
Решение:
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