如何使用hgsvn从本地(file:///)SVN存储库进行克隆?

时间:2013-03-15 19:21:29

标签: svn hgsubversion

目前我正在尝试运行远程subversion存储库的克隆。远程存储库仅在非常慢的链接上可用,因此我使用svnsync创建了本地subversion存储库。在将近三十个小时之后,我现在拥有了subversion存储库的本地副本。

我现在如何将其克隆到新的mercurial存储库?问题是使用file:///的以下形式似乎都不起作用:

$ hg clone svn+file:///home/user/repo repo.hg
abort: repository svn+file:///home/user/repo not found!
$ hg clone file+svn:///home/user/repo repo.hg
abort: repository file+svn:///home/user/repo not found!
$ hg clone file:///home/user/repo repo.hg
abort: repository /home/user/repo not found!

相反svn info file:///home/user/repo 确实向我提供了信息,并证明在那个地方有一个合适的subversion存储库。 svn://显然毫无意义,因为我没有在本地运行服务器。

我也尝试过:

$ hgimportsvn file:///home/user/repo repo.hg
SVN branch isn't a copy
Finished! You can now pull all SVN history with 'hgpullsvn'.

hgpullsvn仅在前半打修改中成功,然后出错:

Interrupted, please wait for cleanup!

External program failed (return code 1): hg '--encoding' 'utf-8' 'remove' '-A' 'branches/Company/CVSROOT'
branches/Company/CVSROOT: No such file or directory

CVSROOT源于之前从CVS转换 Subversion,显然。这是在我的时间之前。)

即使我尝试使用hgsvn强制file:///svn+file:///也不理解hg协议说明符吗?

注意:我之前尝试通过hgsvnhgsvn进行克隆,但最后在经过一段时间后通过hgsvn进行同步时遇到错误。由于克隆整个历史需要很长时间,因此我使用了本地的subversion存储库副本,我打算通过{{1}}克隆,就像我过去那样远程复制。

2 个答案:

答案 0 :(得分:3)

只是意见:不要使用hgsvn,从2010年开始“处于维护模式”,将hgsubversion扩展添加到Mercurial并用它克隆Subversion存储库

PS:“svn +”前缀仅对http服务的存储库有用(因为您可以使用http://进行Subversion,Mercurial,Git)。本地Subversion repo(使用hgsubversion克隆)将是file:///

答案 1 :(得分:1)

我又遇到了这个问题。这是错误配置或未安装hgsubversion扩展名的一个症状。

确保您的.hgrcMercurial.ini(全球或本地)中的相应行符合on the documentation site for HgSubversion。示例(根据需要调整路径):

[extensions]
hgsubversion = ~/hgsubversion/hgsubversion

然后检查:

hg help hgsubversion
hg help subversion

我的猜测是,如果没有扩展程序,Hg根本不知道该文件夹中会发生什么,所以需要一个它无法找到的Mercurial仓库。

在我的情况下,这是通过覆盖本地~/.hgrc而导致再次