如何跳过 svnsync 同步中的初始修订(以修复损坏的存储库)
我想使用(通常)序列从中等大型 SVN 存储库中同步/复制单个项目
svnadmin create %mirror%
rem make insecure dummy hook
echo rem dummy > %mirror%\hooks\pre-revprop-change.bat
svnsync init %mirror_url% http://svn/original/...
svnsync sync %mirror_url%
这可以工作,但需要很长时间,请参阅 相关问题。事实上,在 r=17830 之前我不需要任何修改。真正的问题是原始存储库在此修订之前似乎已损坏,我无法将其转换为 hg,所以我尝试解决方法...
问题: 有没有办法伪造新创建的存储库(在第 4 行之后),以便它“相信”它已经具有修订版 17830 并继续更新版本。 (也许有一些道具魔法?)在该修订之前,项目/文件夹没有任何变化。
I want to sync/copy a single project out of a moderate large SVN repo using the (usual) sequence
svnadmin create %mirror%
rem make insecure dummy hook
echo rem dummy > %mirror%\hooks\pre-revprop-change.bat
svnsync init %mirror_url% http://svn/original/...
svnsync sync %mirror_url%
This works but takes long time, see related question. In fact I do not need any revisions prior to e.g. r=17830. And the real problem is that the original repo seems to be corrupt before this revision and I can't convert it to hg, so I try to workaround ...
Question:
Is there a way to fake the newly created repo (after 4th line) so it "believes" it has revision 17830 already and continues with newer ones. (Maybe some propset magic?) There are no changes in the project/folder before that revision.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
svnsync 将根据(目标存储库的)“当前”文件中的值以及 svnsync revprop 0 文件中的条目(表明哪个是最后复制的修订版)来复制修订版。初始化 svnsync,然后将这两个数字修改为您想要的版本,它应该按您想要的方式工作。
svnsync will copy revisions based on value in the 'current' file (of the destination repo), and the entry in the svnsync revprop 0 file that says which is the last revision copied. Initialise svnsync, then fudge both of these numbers to your desired revision and it should work as you want.
这是可能的。
您需要在文件夹
\db\revprops\0
和\db\revs\0
中创建虚拟 rev 文件,这样就不会出现错误没有修订版 17830
。This is possible.
You need to create dummy rev files in the folders
\db\revprops\0
and\db\revs\0
so that you don't get the errorthere is no revision 17830
.SVN 邮件列表对此主题有一个答案;请参阅http://svn.haxx.se/dev/archive-2010- 02/0114.shtml
The SVN mailing list has an answer to that topic; see http://svn.haxx.se/dev/archive-2010-02/0114.shtml
从我基于答案和帮助的实验来看,我相信这是不可能的。
From my experiments based and helped by the answers, I believe this is not possible.
试试这个,(刚刚弄清楚)
1)检查您正在同步到的存储库的工作副本
2a)使用 svn diff -rcurrent:next 从源存储库生成补丁
(所以 current 是当前版本,next 是下一个被破坏的版本)
然而,我发现大多数 svn diff 仍然有效
2b) 或者,将一个虚拟文件添加到您要同步的存储库并标记它(这样您就可以
可以检查一些东西)
3)执行 svn ci -m 'syncfix' 这将改变你正在同步的存储库
4)在此之后,svnsync 同步将在大部分时间继续
5)有时它会抱怨 HEAD 是其中的一个修订未来。要解决这个问题
转到/db/revprops/0
编辑0文件,
chmod +w 0
修改版本,
6) 之后,svnsync 同步将继续
7) 下面是我刚刚为克服这些障碍而编写的脚本,
最终的结果可能并不完美,但它会包含大部分内容。
然后您可以通过从存储库的 HEAD 导出来修复最终结果
您正在同步。
翁德雷·波普
Try this, (just figured this out)
1) check out a working copy of the repository you are syncing to
2a) generate a patch with svn diff -rcurrent:next from the source repository
(so current is the current revision, and next is the next one that is broken)
however, most of the I found svn diff still works
2b) or, add a dummy file to the repository you are syncing to and tag it (so you
can check in something)
3) do a svn ci -m 'syncfix' which will bump the repository you are syncing to
4) after this, svnsync sync will continue most of the time
5) sometimes it will complain the HEAD is one revision in the future. To fix this
go to /db/revprops/0
edit the 0 file,
chmod +w 0
bump the revision,
6) after this, svnsync sync will continue
7) below is a script I just made to get over the bumps,
the end result will probably not be perfect but it will get most of the stuff in.
then you can fix the end result by exporting into it from the HEAD of the repository
you are syncing from.
Ondrej Popp