Mercurial 使用文件映射转换为单独的子文件夹会创建空存储库

发布于 2024-09-07 00:05:40 字数 609 浏览 11 评论 0原文

我有一个从 svn 存储库转换而来的大型 Hg 存储库(2+GB)。它有许多网站,我们希望将它们分成单独的 Hg 存储库。存储库位于 Windows 2008 Server 上,我们使用 TortoiseHg 附带的 hg。

我们一直在尝试使用带有文件映射的转换方法从转换后的存储库创建新的存储库。

问题是该命令运行了源存储库中的所有变更集,但新创建的存储库是空的。

命令行如下所示:

hg convert -s hg --filemap "hgsplitstaticsites-site1.txt" staticsites-hg "C:\projects\marcelsprojects\hgversions\site1-hg"

文件映射如下所示:

include staticsites-hg/site1
rename staticsites-hg/site1 .

任何帮助将不胜感激。

我们还尝试在 svn 存储库中的子文件夹上运行 hg Convert,但这实际上会引发异常并退出。


我们放弃了这一点,只是将子文件夹分成单独的 Hg 存储库,并丢失了所有版本历史记录。

I have a large Hg repository (2+GB) that was converted from an svn repository. It has a number of websites in it, and we want to separate those out into separate Hg repos. The repositories are on a Windows 2008 Server and we're using the hg that comes with TortoiseHg.

We've been trying to use the convert method with a filemap to create a new repo from the converted repository.

The problem is that the command runs through all the changesets in the source repo, but the newly created repo is empty.

This is what the command line looks like:

hg convert -s hg --filemap "hgsplitstaticsites-site1.txt" staticsites-hg "C:\projects\marcelsprojects\hgversions\site1-hg"

The filemap looks like this:

include staticsites-hg/site1
rename staticsites-hg/site1 .

Any help would be greatly appreciated.

we've also tried running hg convert on the subfolder in the svn repository, but that actually throws an exception and exits.


We gave up on this one, and just separated the sub folders into separate Hg repos, and lost all of the version history.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

时光礼记 2024-09-14 00:05:40

我也遇到了空存储库的问题。我的问题是,我在文件映射中使用了 Windows 样式的路径名(使用反斜杠而不是普通斜杠),如下所示:

include src\file1.pas
include src\file2.pas
...

但它必须采用 POSIX 格式:

include src/file1.pas
include src/file2.pas
...

显然,您也不能在前面添加 ./ 到路径,因为它也生成了一个空存储库。

您的文件映射看起来不错,所以这不可能是您的情况的原因,但这可能会帮助遇到此问题的其他人并通过 Google 找到此页面。

I also just had the problem with the empty repository. The problem in my case was that I used Windows-style path names (with backslash instead of a normal slash) in my filemap like this:

include src\file1.pas
include src\file2.pas
...

But it had to be in the POSIX format:

include src/file1.pas
include src/file2.pas
...

Apparently you also may not prepend ./ to the path as it produced an empty repository as well.

Your filemap looks okay, so this could not have been the cause in your case, but maybe this will help others who are having this problem and find this page through Google.

乱了心跳 2024-09-14 00:05:40

这个答案很准确:您实际上并没有创建一个空目录,而是一个带有隐藏 .hg 目录的目录。如果您

hg update

在目标目录中运行,您将获得目标目录及其预期的所有内容。

This answer was spot on: you don't actually create an empty directory, but a directory with a hidden .hg directory. If you run

hg update

in your target directory, you will have your target directory with all its contents as expected.

天煞孤星 2024-09-14 00:05:40

我的空存储库问题是由于文件映射中的路径名大小写错误所致。

My problem with empty repository was due to pathnames in the filemap were of the wrong case.

坦然微笑 2024-09-14 00:05:40

我编写了一个批处理脚本来帮助运行 hg Convert 命令。 我可以克隆 Mercurial 存储库的一部分吗?

I wrote a batch script to help with running the hg convert command. Can I clone part of a Mercurial repository?

满天都是小星星 2024-09-14 00:05:40

hg Convert 的输出是什么?空存储库是什么意思?如果您在目标存储库中执行hg log,您是否有任何条目?

What is the output of hg convert? What do you mean by empty repository? If you do hg log in target repository, do you have any entries?

梦初启 2024-09-14 00:05:40

我遇到了同样的问题,这是由您的包含行引起的。您需要指定相对路径,而不是存储库路径。

例如,

svnrepo > branches |
        | tags     |
        | trunk    > Project1
                   | Project2

您的文件映射应该如下所示,

包括 Project1

I had the same issue, it's caused by your include line. You need to specify relative path, not the repository one..

E.g

svnrepo > branches |
        | tags     |
        | trunk    > Project1
                   | Project2

Your filemap should look like this

include Project1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文