首先建立一个空的repository,svnadmin create svn。
起初想尝试在已有的repository中单独创建一个目录来做备份,但是反复尝试无数次,失败告终。
因为只能在ROOT下做同步,我查便了svnserve命令也没找到怎么以子目录为ROOT启动svn,所以,只有新建了。
新建后首先配权限,这个不多说。接下来将hooks下的pre-revprop-change.tmpl重命名为pre-revprop-change。注意了,linux下的同志们,没有sh,我就在这卡了N久。
接下来启动svn同步。首先初始化版本库,此时还没有备份任何数据:
svnsync init svn://localhost http://OpenSVN.csie.org/project
看见网上很多人用
svnsync init svn://localhost/project0 http://OpenSVN.csie.org/project
我就纳闷了,我这始终提示错误
Session is rooted at 'svn://localhost/project0' but the repos root is 'svn://localhost'
接下来备份数据:
svnsync sync svn://localhost
如果遇见Changing revision properties other than svn:log is prohibited,则修改pre-revprop-change文件为exit 0
当同步过程中异常退出的话,再同步时会出现Failed to get lock on destination repos, currently held by '****' 错误,解决办法是执行svn propdel svn:sync-lock --revprop -r 0 svn://localhost
差不多就这样了吧。看来我得再研究下怎么以子目录为ROOT启动svn了。