将SVN迁移到HG,以这种方式将其拆分为子存储库(但保留合并的日志) [英] Migrate SVN to HG, splitting it into subrepos in the way (but keeping combined log)

查看:123
本文介绍了将SVN迁移到HG,以这种方式将其拆分为子存储库(但保留合并的日志)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SVN存储库,该存储库的主干中包含许多与松散相关的子文件夹.
我想将其转换为HG储存库,并将每个子文件夹转换为单独的HG子仓库.
同时,我想访问顶级存储库中所有子存储库的组合更改日志.

I have an SVN repository which contains a number of loosely-related subfolders in its trunk.
I would like to convert it into HG repository, turning each of these subfolders into a separate HG subrepo.
At the same time, I would like to access combined change log of all subrepos in the top level repo.

所以我创建了一个空的HG仓库,一些空的子仓库,并通过.hgsub链接了它们的名称和位置,并检查了我是否可以将该子仓库与它的子仓库一起克隆到另一个组件中...

So I created an empty HG repo, some empty subrepos, linked their names and locations by .hgsub , checked that I can clone this repo together wth its subrepos to another comp ...

然后我尝试将部分SVN克隆创建到子存储库(为每个子存储库使用.../trunk/subfolder指定SVN URL).但是由于我不知道的原因,他们没有出现在顶级HG历史中.

Then I tried to make partial SVN clones to subrepos (specifying SVN URL with .../trunk/subfolder for each subrepo). But they did not show in top-level HG history for a reason unknown to me.

我从头开始,尝试将SVN中继URL放入顶级.hg/hgrc并执行"hg pull".但这将整个SVN存储库拉到了顶层,而子存储库则为空.

I started from scratch, and tried to put SVN trunk URL into top-level .hg/hgrc and to do 'hg pull'. But it pulled the whole SVN repo into top level, and subrepos were left empty.

现在我问你下一步该怎么做?
由于我是HG的新手,所以我可能错过了一些东西. 您的任何建议,我将不胜感激.

And now I would ask you what do to next ?
Probably I am missing something since I am new to HG. I would appreciate any your advise.

推荐答案

关于汞子仓库,报告修订历史记录和单个文件状态会有些复杂.

Reporting revision history and individual file statuses get a little bit complex when it comes to Hg subrepos.

子存储库的修订历史记录在父存储库中不可见.当您考虑它时,这是有道理的,因为每个子存储库实际上是一个不同的存储库-确实没有重叠两个单独历史记录的好方法,信息也不会很有用.从命令行,您将必须导航到每个subrepo目录,并执行hg log来查看历史记录.在TortoiseHg 2.X.X的 commit视图中,您可以双击带有S标记的任何内容,以在TortoiseHg GUI中打开该子存储库.

The revision history of a subrepo is not visible from the parent repository. This makes sense when you think about it because each subrepo is literally a different repository - there is really no good way to overlay two separate histories, nor would that information be very useful. From the command line you would have to navigate into each subrepo directory and execute a hg log to see the history. From TortoiseHg 2.X.X, from the commit view, you can double click on anything marked with an S to open up that subrepo in the TortoiseHg GUI.

可以从父存储库中看到对子存储库的本地修​​改,但不一定对每个命令都采用相同的方式.例如,如果我有一个看起来像这样的存储库(其中sub是子存储库):

Local modifications to subrepos can be seen from the parent repo, but not necessarily in the same way for each command. For example, if I have a repository that looks like this (where sub is a subrepo):

/project
  |
  ----> foo.c
  |
  ----> sub/
         |
         ----> bar.c
         |
         ----> more.c

如果我同时修改bar.c和foo.c,然后从命令行执行hg status,我将看到以下内容:

If I modify both bar.c and foo.c and then perform an hg status from the command line I will see the following:

> hg status
M    foo.c

但是,如果我添加subrepo参数-S,我会看到:

But if I add the subrepo argument -S I would see:

> hg status -S
M    foo.c
M    sub/bar.c

如果我使用的是TortoiseHg v2.X.X,它将foo.c标记为已修改,并且会将sub标记为已修改,但是我必须双击子仓库以查看实际的文件修改.

If I am using TortoiseHg v2.X.X it will mark foo.c as modified and it will mark sub as modified, but I would have to double click the subrepo to view the actual file modifications.

转换说明:

就转换本身而言-查看转换存储库扩展名.如果您执行一次转换,然后放弃SVN信息库,那么您可能就需要这些.如果您要尝试在SVN和HG之间来回工作,您可能还会遇到一些其他问题.

In terms of performing the conversion itself - check out the convert repository extension. If you are performing a one time conversion and then abandoning the SVN repository this would probably be all you need. If you're going to try and work back and forth between SVN and HG you will probably have a few more issues.

我过去成功完成的工作是将Hg存储库覆盖在现有存储库的顶部.我不确定这对SVN和Hg是否会很好.

Something I've done successfully in the past is overlay a Hg repository on top of an existing repository. I'm not sure if this would work well for SVN and Hg, however.

这篇关于将SVN迁移到HG,以这种方式将其拆分为子存储库(但保留合并的日志)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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