我有以下脚本,用于稀疏地检查SVN中某个修订版本的文件。我想将这些文件复制为"补丁"各种。
repo文件夹已签出为--depth empty
,因此在运行此脚本之前,repo的根目录应该只有.svn
。我做了这个,因为回购很庞大,我只想快速创建一个特定版本的补丁。
for currentFile in $(svn log -r 3131 -v | grep "/branches" | cut -c 7-)
do
curDir="$(dirname $currentFile)"
curName=$(basename "$currentFile")
svn checkout svn://localhost/LocalRepo@3131 $curDir --depth empty
cd $curDir
svn up -r 3131 $curName
cd /e/partials/RepoInstance
done
for循环获取我想要的内容。
curDir
和curName
似乎提取了正确的字符串。
目录的checkout
会创建文件夹,但up
不会创建文件,但也不会出错。
up
说Updating myFile.blah to revision 3131
,然后说At revision 3131
,就像它有效一样。
我最初在没有文件夹签出的情况下更简单,cd
进出,但我遇到了诸如svn: E155007: None of the targets are working copies
之类的问题。