我想将文件夹从一个存储库移动到另一个存储库(当然,同时保留所有历史记录)。我跟着问题“How to move a single folder from one Subversion repository to another repository?”的一些答案。特别是,我尝试了命令:
svnadmin.exe dump H:\Repositories\RepSource > W:\temp\RepSource.dump
svndumpfilter.exe include "trunk\Sources\folderToMove" --drop-empty-revs --renumber-revs --preserve-revprops < W:\temp\RepSource.dump > W:\temp\RepSource_filtered.dump
svnadmin.exe load "H:\Repositories\RepDest" < W:\temp\RepSource_filtered.dump
RepDest是我为测试而创建的空存储库。倾倒成功运行;根据输出过滤,显示所有文件夹都被删除但指定的文件夹。加载有一些问题;它有输出:
<<< Started new transaction, based on original revision 1 * editing path : trunk/Sources/folderToMove/theFile.mxml ...svnadmin: File not found: transaction '0-1', path 'trunk/Sources/folderToMove/theFile.mxml'
“the.file.mxml”是“folderToMove”文件夹中的文件。
我注意到了一些魔力:在svndumpfilter中,我在include路径的末尾添加了一个反斜杠:
svndumpfilter.exe include "trunk\Sources\folderToMove\" --drop-empty-revs --renumber-revs --preserve-revprops < W:\temp\RepSource.dump > W:\temp\ RepSource_filtered.dump
输出如下:
<<< Started new transaction, based on original revision 1 ------- Committed revision 1 >>> <<< Started new transaction, based on original revision 2 ------- Committed revision 2 >>> <<< Started new transaction, based on original revision 3 ------- Committed revision 3 >>> <<< Started new transaction, based on original revision 4 ------- Committed revision 4 >>> <<< Started new transaction, based on original revision 5 ------- Committed revision 5 >>> <<< Started new transaction, based on original revision 6 ------- Committed revision 6 >>> <<< Started new transaction, based on original revision 7 ------- Committed revision 7 >>> <<< Started new transaction, based on original revision 8 ------- Committed revision 8 >>> <<< Started new transaction, based on original revision 9 ------- Committed revision 9 >>> <<< Started new transaction, based on original revision 10 ------- Committed revision 10 >>> <<< Started new transaction, based on original revision 11 ------- Committed revision 11 >>> <<< Started new transaction, based on original revision 12 ------- Committed revision 12 >>> <<< Started new transaction, based on original revision 13 ------- Committed revision 13 >>> <<< Started new transaction, based on original revision 14 ------- Committed revision 14 >>> <<< Started new transaction, based on original revision 15 ------- Committed revision 15 >>>
它似乎很成功,但是当我查看RepDest存储库(使用TortoiseSVN-&gt; Repo浏览器或VisualSVN服务器管理器)时,其中没有任何内容。它保持空白。 HEAD版本号为0.但是如果我用以下内容查看此存储库:
svnlook tree H:\Repositories\RepDest -r 5
我再次看到空存储库,但它识别出修订号。正确处理1到15之间的所有修订号。为了测试,“-r 16”导致svnlook告诉我这个修订版本不存在。
我还检查了RepDest存储库文件夹的大小 - 在加载之前和之后它是一样的。
这里有什么问题?有什么想法吗?
答案 0 :(得分:0)
查看svnadmin load
命令的帮助。在存储库中加载目录时是否指定了--parent-dir
参数?否则,它将进入错误的目录。
您必须通过--parent-dir
参数将该目录加载到当前存储库中的不存在的目录中。从您显示的命令,看起来您没有指定此目录的位置。我不记得了,但我也相信你必须在加载之前在你的存储库中创建这个空的父目录。
当然,在执行svnadmin load
之前备份和关闭Subversion。