만약
game/source/app
game/source/app/file.txt
game/source/app/subfolder
와 같이 있는 파일 및 폴더를
game/source/trunk
안에 옮기고자 할려면
일단 아래와 같은
svn move “game/source/app” “game/source/trunk”
move명령어는 같은 폴더라 실행은 안되고
app폴더를 임의 temp폴더로 복사하고 app폴더를 삭제 후
trunk, branches, tags폴더를 만들고 trunk폴더안에 temp폴더의 내용을 옮겨야 합니다.
그리고 파일을 app폴더에서 temp폴더로 옮길 때 *(wildcards)가 실행되지 않아서
Linux면 아래의 URL처럼 shell script로 되는데…
(http://subversion.tigris.org/faq.html#sorry-no-globbing)
# 옮길 SVN의 URL값을 읽어들임
$moveList = Get-Content d:\temp\moveList.txt
foreach($moveFile in $moveList)
{
$url = "http://pccafe2.ncsoft.dev:8080/svn/" + $moveFile
echo "URL[$url]"
# URL의 마지막 폴더명 구하기
$splittedUrl = $moveFile.split("/")
$lastFolder = $splittedUrl[$splittedUrl.length - 1]
svn ls "$url" > "FILE_LIST_$lastFolder.xml"
$fileList = Get-Content "FILE_LIST_$lastFolder.xml"
foreach($file in $fileList)
{
# URI형식으로 주소값 변경(변경하지 않으면 한글이나 띄어쓰기 있는부분에서 에러남)
$sourceUri = [System.URI] "$url/$file"
$targetUri = [System.URI] "http://pccafe2.ncsoft.dev:8080/svn/game/backup/$lastFolder/$file"
# 파일 복사
svn copy --parents $sourceUri.AbsoluteUri $targetUri.AbsoluteUri -m "copy backup"
}
}
옮기는경우가 많지 않으면, TortoiseSVN에서 마우스 오른쪽 버튼으로 드래그한후 move메뉴를 실행하면 된다.
ㅇ. 참고
http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx