Chinaunix首页 | 论坛 | 博客
  • 博客访问: 799019
  • 博文数量: 770
  • 博客积分: 5000
  • 博客等级: 大校
  • 技术积分: 4950
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-09 17:49
文章分类

全部博文(770)

文章存档

2011年(1)

2008年(769)

我的朋友

分类:

2008-10-10 11:06:04

SVN 从 1.4 版本以后提供了一个独立的程序, svnsync, 用于同步两个版本库; 需要注意 hotcopy 仅用于本地的热备与 svnsync 功能类似但实质不同.

以下操作假定用户已提供两个 SVN 的操作接口, DEST_URI, SRC_URI( DEST_URI 是目的端地址, 用于接受数据; SRC_URI 是当前版本库)
# svnsync initialize DEST_URI SRC_URI --username cax  --password password_for_cax
Copied properties for revision 0.
初始化完成, 开始同步数据:
# svnsync synchronize DEST_URI
Committed revision 1.
Copied properties for revision 1.
Committed revision 2.
....



错误处理:
在源端, 同步用的帐号需要有读权限, 在目的端同步帐号需要读写权限. 权限分配合理后,基本上就不会出现其他错误.

如果出现以下列出的之外的错误, 请先检查一下svn 服务是否可正常使用.
比较常见的错误是:
# svnsync initialize DEST_URI SRC_URI --username cax  --password password_for_cax
svnsync: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svnsync: At least one property change failed; repository is unchanged

这是由于系统中没有 pre-revprop-change 钩子脚本导致的, 该文件在版本库的 ~/hooks/ 下, 只需拷贝一份即可.
cp -pf hooks/pre-revprop-change.tmpl hooks/pre-revprop-change

如果是windows系统, 还需要清空 pre-revprop-change 的内容, 并添加后缀为 pre-revprop-change.bat
在批处理文件中, Linux下 shell 中注释符 #  不能被 batch 正确解释也会重复出现该错误.

.      
--------------------next---------------------

阅读(483) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~