为什么 Mercurial 子存​​储库在 Eclipse 和 torotoiseHG 中表现为未版本控制的文件

发布于 2024-09-03 06:01:51 字数 1109 浏览 6 评论 0原文

我正在尝试使用 Mercurial 的子存储库功能,使用 Mercurial Eclipse 插件\tortoiseHG。

这些是我采取的步骤:

  1. 创建一个空目录 /root
  2. 克隆我想要成为此文件夹内子存储库的所有存储库(/root/sub1/root /sub2)
  3. 在根存储库 /root/.hgsub 中创建并添加 .hgsub 文件,并
  4. 使用 tortoiseHG 将 子存储库的所有映射放入其中,右键单击/root
  5. 再次使用tortoise选择在此处创建存储库,选择/root内的所有文件并将它们添加到根目录repo
  6. 提交了根存储库
  7. 将本地根存储库推送到我在 kiln 上设置的空存储库

然后,我使用 import->mercurial 在 eclipse 中拉取了根存储库。

现在我看到所有子存储库看起来都好像没有版本控制(在 Eclipse 文件资源管理器中相应的文件夹旁边没有“橙色圆柱体”图标)。

此外,当我右键单击其中一个子存储库时,我不会像通常那样在根项目中获得“团队”菜单中的所有 hg 命令 - 没有“拉”、“推”等。

此外,当我对子存储库中的文件进行了更改,然后“提交”了根项目,它告诉我没有发现任何更改。

我在 tortoiseHG 中也看到了相同的行为 - 当我浏览 /root 下的文件时,直接属于根存储库的文件上有一个小图标(V 形符号),标记它们是版本控制的,而子存储库的文件夹没有这样标记。

是什么让我怀疑这是我这边的一些错误,是这样的 1. tortoise 和 eclipse 都做同样的事情,所以两者中出现 bug 的可能性较小 2. 他们所做的看起来相当复杂,所以不太可能发生错误 - 他们都忽略 .hgsub 中的所有文件夹。如果发生相反的情况(所有子存储库都被视为主存储库的常规文件夹,而不是被视为未版本化),我会认为这是由于不处理子存储库而导致的错误。但显然两个应用程序都承认 .hgsub 文件

我做错了什么,还是一个错误?

I am trying to use the subrepo feature of mercurial, using the mercurial eclipse plugin\tortoiseHG.

These are the steps I took:

  1. Created an empty dir /root
  2. cloned all repos that I want to be subrepos inside this folder (/root/sub1, /root/sub2)
  3. Created and added the .hgsub file in the root repo /root/.hgsub and put all the mappings of the sub repos in it
  4. using tortoiseHG, right clicked on /root and selected create repository here
  5. again with tortoise, selected all the files inside /root and added them to to the root repo
  6. commited the root repo
  7. pushed the local root repo into an empty repo I have set up on kiln

Then, I pulled the root repo in eclipse, using import->mercurial.

Now I see that all the subrepos appear as though they are unversioned (no "orange cylinder" icon next to their corresponding folders in the eclipse file explorer).

Furthermore, when I right click on one of the subrepos, I don't get all the hg commands in the "team" menu as I usually get, with root projects - no "pull", "push" etc.

Also, when I made a change to a file in a subrepo, and then "committed" the root project, it told me there were no changes found.

I see the same behavior also in tortoiseHG - When I am browsing files under /root, the files belonging directly to the root repo have an small icon (a V sign) on them marking they are version controlled, while the subrepos' folders aren't marked as such.

What makes me suspect it's some error on my side, is that
1. both tortoise and eclipse do the same thing, so it's less probable to be a bug in either one
2. What they do looks rather sophisticated, so not probable to happen by a bug - they both ignore all folders that are in .hgsub. Had the opposite happened (all subrepos treated as regular folders of the main repo rather than being treated as unversioned), I would have thought it's a bug caused by not treating subrepos. But clearly both apps acknowledge the .hgsub file

Am I doing something wrong, or is it a bug?

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

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

发布评论

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

评论(2

泪是无色的血 2024-09-10 06:01:51

在第一步中,您在根存储库中是否有实际的嵌套 Mercurial 存储库?
如果它只是 main 的子目录,则将 .hgsub 与“subdir = subdir”指令一起放置不足以使 subdir 成为子存储库存储库(没有任何自己的 .hg)。

正如文档中所说:

请注意,嵌套存储库必须实际存在,.hgsub 中的行才能执行任何操作
例如,如果您尝试链接到预先存在的远程存储库,而不是创建本地嵌套存储库,则还必须克隆该存储库:

$ echo nested = https://example.com/nested/repo/path > .hgsub
$ hg add .hgsub
$ hg clone https://example.com/nested/repo/path nested

当有疑问时,请始终尝试在命令中重复您所做的操作(直到推送)行,看看 Hg CLI(命令行界面)会话可以向您显示什么。
您可以在当前存储库的克隆上进行实验,看看出了什么问题。

现在,如果您确实有嵌套的 Hg 存储库,那么插件“MercurialEclipse”仍然有可能没有尚不支持 subRepos。
它在发行说明中根本没有提及子存储库。
而 TortoiseHg 仅在其最新 1.0 版本中提到了它们。

状态/提交工具中支持子存储库

In your first step, did you have actual nested Mercurial repos in the root repo?
Putting a .hgsub with "subdir = subdir" directive is not enough to make subdir a subrepo, if it was just a sub directory of main repo (without any .hg of its own).

As said in the documentation:

Note that the nested repository must actually exist for the line in .hgsub to do anything.
For instance, if rather than creating a local nested repository you attempt to link to a pre-existing remote one, you must ALSO clone that repository:

$ echo nested = https://example.com/nested/repo/path > .hgsub
$ hg add .hgsub
$ hg clone https://example.com/nested/repo/path nested

When in doubt, always try to repeat what you do (up until the push) in a command line, to see what a Hg CLI (command Line Interface) session can show you.
You can experiment on a clone of your current repo to see what went wrong.

Now if you did have nested Hg repos, then there still is the possibility the the plugin "MercurialEclipse" doesn't support yet subRepos.
It doesn't mention subrepos at all in its release notes.
And TortoiseHg only mentions them in its latest 1.0 release.

Support for subrepos in the status/commit tool

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