Mercurial 子存​​储库可以驻留在子文件夹中吗?

Can a Mercurial subrepostiory reside in a subfolder?

多年来我在 .hgsub 中使用了以下行:

setup/help = https://my.repo.com/manuals

它会将名为 "manuals" 的存储库放入另一个文件夹 setup 内的文件夹 help 中。所以我的父存储库结构如下所示:

.hg
setup
|__help
|  |__.hg
|
.hgsub

在我今天更新到 Mercurial 4.9 之前,这是没有问题的,它现在显示:"subrepo path contains illegal component: setup/help",我什至无法提交到主仓库。 Mercurial 现在禁止这样做吗?是否有有效的 .hgsub 语法来完成这项工作?我不想移动 help 成为主项目文件夹的直接子文件夹。我之前的Mercurial版本是4.5,不像是用的老工具...

根据请求进行错误回溯:

Traceback (most recent call last):
  File "mercurial\scmutil.pyo", line 165, in callcatch
  File "mercurial\dispatch.pyo", line 367, in _runcatchfunc
  File "mercurial\dispatch.pyo", line 1021, in _dispatch
  File "mercurial\dispatch.pyo", line 756, in runcommand
  File "mercurial\dispatch.pyo", line 1030, in _runcommand
  File "mercurial\dispatch.pyo", line 1018, in <lambda>
  File "mercurial\util.pyo", line 1670, in check
  File "mercurial\commands.pyo", line 4621, in push
  File "mercurial\context.pyo", line 277, in sub
  File "mercurial\subrepo.pyo", line 164, in subrepo
  File "mercurial\subrepo.pyo", line 414, in __init__
Abort: subrepo path contains illegal component: setup/help
abort: subrepo path contains illegal component: setup/help

您对 Python 调试器有多自信?这次您可以使用 --debugger 启动命令。

您可能会看到这样的输出:

entering debugger - type c to continue starting hg or h for help
--Call--
> /usr/lib64/python2.7/contextlib.py(21)__exit__()
-> def __exit__(self, type, value, traceback):
(Pdb)

输入 center,直到您看到与您粘贴的相同的回溯。

当你在正确的回溯处时,你可以使用pp rootpp util.expandpath(root)os.path.realpath(util.expandpath(root))打印局部变量。我们应该能够通过这些变量的值找到问题的根源。

要退出调试器,请输入 qenter

我有同样的错误,所以我克隆了 mercurial 存储库...

错误是在标记版本 4.9 中引入的,subrepo.py。

大约一个月后更正,修订版 41583 (87a6e3c953e045d92147925fc71aad7c327fdbfd)。 我在实际的默认分支上测试了它,再次工作!

所以,不需要错误记录,我们只需要等待下一个版本。