SVN上的HG Convert提供了“看起来不像Subversion存储库" [英] HG Convert on SVN gives "does not look like a Subversion Repository"

查看:110
本文介绍了SVN上的HG Convert提供了“看起来不像Subversion存储库"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Mercurial-2.9上安装了TortoiseHG v2.11

I just installed TortoiseHG v2.11 with Mercurial-2.9

我正在尝试转换使用TortoiseSVN 1.8创建的本地Subversion存储库. 4,Subversion 1.8.5

I am attempting to convert my local Subversion repositories created with TortoiseSVN 1.8. 4, Subversion 1.8.5

为确保我的旧Subversion存储库没有任何古怪的怪癖,我创建了一个新的SVN存储库,名为test_repo,具有默认的文件夹结构,对Check_repowc执行Checkout,然后将一些文本文件添加到了主干中,然后进行了修改和几次提交文件以提供一些历史记录.

To be sure that my old Subversion repositories don't have any weird quirks I created a new SVN repo called test_repo with the default folder structure, performed a Checkout to test_repowc, then added some text files to the trunk, then modified and committed the files a few times to provide some history.

然后我打开cmd.exe,导航到该文件夹​​并尝试

I then opened cmd.exe, navigated to the folder and tried

hg convert test_repo

并获得以下信息:

assuming destination test_repo-hg
initializing destination test_repo-hg repository
test_repo does not look like a CVS checkout
test_repo does not look like a Git repository
file:///C:/Users/xxxxxx/Documents/Subversion/test_repo does not look like a Subversion repository
test_repo is not a local Mercurial repository
test_repo does not look like a darcs repository
test_repo does not look like a monotone repository
test_repo does not look like a GNU Arch repository
test_repo does not look like a Bazaar repository
cannot find required "p4" tool
abort: test_repo: missing or unsupported repository

如您所见,Mercurial为我执行了file:///协议,但无法识别Subversion存储库.我尝试自己执行file:///协议,使用-s标志指定存储库类型,在文件夹中运行Mongoose并以URL形式访问存储库,但似乎都没有用.我也尝试过从工作副本而不是从存储库转换,但这也不起作用.

As you can see, Mercurial did the file:/// protocol for me, but was unable to recognize the subversion repository. I've tried doing the file:/// protocol myself, specifying the repository type with the -s flag, running Mongoose in the folder and accessing the repository as a URL, and none of it seems to work. I've also tried converting from the working copy instead of from the repository, but that doesn't work either.

我想知道这是否与SVN 1.7或1.8引入的新SVN文件结构有关(某些SVN客户端在一段时间内不兼容)?

I'm wondering if it has to do with the new SVN file structure that SVN 1.7 or 1.8 introduced (which some SVN clients were incompatible with for a while)?

使用当前版本的TortoiseSVN和TortoiseHG,还有其他人对此感到幸运吗?

Has anyone else had luck with this using current versions of TortoiseSVN and TortoiseHG?

我打算将其转变为一种超级快捷的方法,使所有人对DVCS和Mercurial感到兴奋,而我已经碰壁了.我读过很多人说这简直太简单了,但是要么我有一个奇怪的边缘案例,要么它不如谣言听起来那么容易.

I was intending on this being a super quick thing to transition, getting all excited about DVCS and Mercurial, and I've already hit a wall. I read lots of people saying it was dead simple, but either I've got a bizarre edge case or it's not as easy as the rumors sound.

我已经阅读了诸如HGSubversion之类的其他工具,可以将SVN克隆为HG存储库,但是由于这些是单独的存储库,因此我只想转换SVN,请确保一切正常,然后删除并卸载SVN.我希望我的HG存储库仍不连接"到SVN(HGSubversion允许从克隆的HG存储库推"到父SVN存储库,对吗?).其他工具的评论则参差不齐,所以我希望转换插件能正常工作.

I've read about other tools like HGSubversion where I could clone my SVN as an HG repo, but since these are solo repositories I'd rather just convert the SVN, make sure everything works, then delete and uninstall SVN. I'd rather my HG repository not still be "connected" to the SVN (HGSubversion allows "push" from the cloned HG repo to the parent SVN repo right?). Other tools have mixed reviews so I was hoping to get the convert extension working.

提前感谢-期待Mercurial!

Thanks in advance - looking forward to Mercurial!

记录Windows解决方案:

Documenting a solution for Windows:

  1. 打开命令提示符
  2. 导航到您的SVN信息库(不是工作副本)
  3. 运行svnserve -r .\ -d
  4. 打开另一个命令提示符
  5. 导航至您想要进行商品回购的位置
  6. 可选:运行where hg ...如果TortoiseHg版本不是第一个,请编辑路径使其成为第一个-此版本包括使用svn://协议所必需的SVN python绑定.编辑路径后,重新启动您的cmd提示符.
  7. 运行hg convert -s svn svn://localhost .\hg_repo_name

  1. Open a Command Prompt
  2. Navigate to your SVN repository (not a working copy)
  3. run svnserve -r .\ -d
  4. Open another Command Prompt
  5. Navigate to where you want your mercurial repo
  6. Optional: Run where hg ... if TortoiseHg version isn't first, edit the path to make it first - this version includes the SVN python bindings which are necessary to use svn:// protocol. Restart your cmd prompt after editing the path.
  7. run hg convert -s svn svn://localhost .\hg_repo_name

  • 我使用的是我的computername.full.domain.name而不是localhost,但是localhost也应该起作用.
  • svn://斜线方向类似于http://file:///而不是C:\
  • 如果您的SVN回购代码没有主干,或者您没有使用主干文件夹(我不准备第一个存储库,因为我不知道自己在做什么),则需要此代码,这表明使用根目录作为主干:
  • I did my computername.full.domain.name instead of localhost, but localhost should work too.
  • svn:// slash direction is like http:// and file:/// not like C:\
  • If your SVN repo code doesn't have a trunk or you didn't use the trunk folder (I didn't for my first repos because I didn't know what I was doing), you need this, which tells mercurial to use the root directory as the trunk:

hg --config config.svn.trunk= convert -s svn svn:\\localhost .\hg_repo_name

  • 我刚刚有一个SVN存储库,在其中我将代码文件夹导入到根目录中,但未导入到主干...我尝试使用上面的代码将主干设置为与代码文件夹名称相同,但是它不起作用...但是,当我将文件夹名称附加到svn url时,它起作用了:

`hg convert svn://%computername%.domain.com/code_folder.\ hg_repo_name

`hg convert svn://%computername%.domain.com/code_folder .\hg_repo_name

祝你好运!

推荐答案

作为转换Wiki 状态

先决条件:

Prerequisites:

Subversion的Python绑定

Subversion's Python bindings

看来(至少)尚未将Python绑定更新为使用带有1.8+存储库的ra_local.

and it seems Python bindings are not updated yet (at least) for using ra_local with 1.8+ repositories.

您有两种选择

  • 创建与1.7兼容的本地 SVN存储库,以供以后转换
  • Create 1.7-compatible local SVN-repositories for later converting

OldRepo>svnadmin create --compatible-version "1.7" .

>svn log file:///Z:/OldRepo
------------------------------------------------------------------------
r1 | Badger | 2014-02-15 00:30:22 +0600 (Сб, 15 фев 2014) | 1 line

Create initial state
------------------------------------------------------------------------
>hg convert file:///Z:/OldRepo HG2-Repo
initializing destination HG2-Repo repository
scanning source...
sorting...
converting...
1 Create initial state
0 Create initial state

使用HGSubversion克隆OldRepo之后的结果相同

The same result after cloning OldRepo using HGSubversion

>hg clone file:///Z:/OldRepo HG-Repo
[r1] Badger: Create initial state
pulled 2 revisions
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

  • 使用 any 服务器访问1.8+版本的存储库(svnserve是最简单的方法).我没有尝试过svn://存储库,但是测试了1.8 Subversion的远程http托管存储库
    • Use any server for accessing 1.8+ repository (svnserve is the easiest way). I haven't tried svn:// repository, but tested remote http-served repository of 1.8 Subversion
    • 只是样品

      hg clone https://subversion.assembla.com/....
      ...
      25 files updated, 0 files merged, 0 files removed, 0 files unresolved
      

      这篇关于SVN上的HG Convert提供了“看起来不像Subversion存储库"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆