Reposurgeon镜像SVN失败问题:原因排查与解决方法
SVN转Git时Repotool镜像失败的解决办法
更新:已找到问题根源,需配置SVN存储密码,具体解决步骤见下文。
问题描述
- 需求:将一个非标准结构的SVN仓库转换为Git仓库
- 环境:WSL/Ubuntu系统,先后使用过apt安装的Reposurgeon 4.31-1版本和仓库中的5.0版本
- 异常现象:git-svn可正常操作该SVN仓库,但Repotool执行镜像操作直接失败;手动执行
svn info --show-item=revision命令能正常返回仓库版本号
Repotool执行错误日志
omannisto@olli-lt:~/repotest2$ repotool initmake AltiumComponentLibrary svn git repotool: a Makefile already exists here. repotool: generating a stub options file. repotool: generating a stub lift file. repotool: generating a stub map file. omannisto@olli-lt:~/repotest2$ nano Makefile omannisto@olli-lt:~/repotest2$ make rm -rf AltiumComponentLibraries-mirror make AltiumComponentLibraries.svn AltiumComponentLibraries.opts AltiumComponentLibraries.lift AltiumComponentLibraries.map make[1]: Entering directory '/home/omannisto/repotest2' repotool mirror http://omannisto@10.4.0.44:8008/svn/oxford/AltiumComponentLibraries AltiumComponentLibraries-mirror Authentication realm: <http://10.4.0.44:8008> Authorization Realm Password for 'omannisto': ********** repotool: executing "/usr/bin/sh -c svn info --show-item=revision http://omannisto@10.4.0.44:8008/svn/oxford/AltiumComponentLibraries": exit status 1 make[1]: *** [Makefile:71: AltiumComponentLibraries-mirror] Error 1 make[1]: Leaving directory '/home/omannisto/repotest2' make: *** [Makefile:62: AltiumComponentLibraries-git] Error 2 omannisto@olli-lt:~/repotest2$ nano Makefile
手动执行svn info的输出
omannisto@olli-lt:~/repotest2$ svn info --show-item=revision http://omannisto@10.4.0.44:8008/svn/oxford/AltiumComponentLibraries Authentication realm: <http://10.4.0.44:8008> Authorization Realm Password for 'omannisto': ********** 37557 omannisto@olli-lt:~/repotest2$
解决办法
问题核心是Repotool执行SVN命令时无法自动获取密码,即使手动输入过密码也无法复用。需要配置SVN自动存储密码:
- 打开SVN全局配置文件:
~/.subversion/servers - 在
[global]段落中添加或修改以下配置项:store-passwords = yes store-plaintext-passwords = yes - 手动执行一次需要输入密码的SVN命令(比如
svn info http://omannisto@10.4.0.44:8008/svn/oxford/AltiumComponentLibraries),输入密码后SVN会自动存储凭证 - 重新运行
make命令执行Repotool镜像操作,此时Repotool能自动读取存储的密码,命令可正常执行
内容的提问来源于stack exchange,提问作者Barleyman
相关产品推荐
相关产品推荐

