<块引用>
注意:由于我是新人,他们不允许我发布链接,这意味着所有配置文件都将具有格式不正确的 URL。这只是为了绕过 stackoverflow 的限制,我在实践中使用了正确的 URL。
我尝试设置一个子存储库,我们称之为 A/B。为了使克隆正常工作,我想要一个正常的相对路径将其放入存储库中,因此从逻辑上讲我有 .hgsub
:
A/B = A/B
但是,当尝试将其推入 bitbucket 时,我得到通常的 404 (未找到)错误,因为 bitbucket B 上不能是本地的,实际上是另一个项目(http s://[email protected]/username/B)
然后我说,好吧,为了让 bitbucket 工作,我可以放入 .hgsub
:
A/B = https://[email protected]/username/B
但是,我最近发现据说这里有一个解决方法: https://www.mercurial-scm.org/wiki/Subrepository 您使用的位置[subpaths]
部分,以便本地克隆正常工作,但 bitbucket 将请求项目的特殊路径。
所以我尝试复制他们的说明。 .hgsub:
A/B = A/B
[subpaths]
https://[email protected]/username/project/A/B = https://[email protected]/username/B
但我得到了同样的 404 错误。据说每当它看到 https://[email protected]/username/project/A/B
,它将重新映射到后者 https://[email protected]/username/B
可以使用。然而,情况似乎并非如此。我也尝试过不将 username@
放在开头。
任何帮助将不胜感激。 :)
NOTE: Since I'm new they won't let me post links, which means all the config files will have improperly formatted URLs. This is simply to get around stackoverflow's limitations, I have used the correct URL in practice.
I tried to setup a subrepo, let's call it A/B. So that cloning works properly, I wanted a normal relative path to put it inside the repository, so logically I had .hgsub
:
A/B = A/B
However when trying to push this into bitbucket I get the usual 404 (NOT FOUND) error because on bitbucket B cannot be local, and is actually another project (http s://[email protected]/username/B)
So then I said, OK just to make bitbucket work I can put .hgsub
:
A/B = https://[email protected]/username/B
However, I recently found out that supposedly there was a workaround here: https://www.mercurial-scm.org/wiki/Subrepository where you use the [subpaths]
section so that cloning locally works normal, but bitbucket will request the special path for the project.
So I tried copying their instructions. .hgsub:
A/B = A/B
[subpaths]
https://[email protected]/username/project/A/B = https://[email protected]/username/B
But I get the same 404 error. Supposedly whenever it sees https://[email protected]/username/project/A/B
, it will instead remap to the latter https://[email protected]/username/B
which will work. However, this doesn't appear to be the case. I have also tried without putting the username@
at the beginning.
Any help would be much appreciated. :)
发布评论
评论(2)
事实证明,我认为我正在另一个仓库进行测试,所以它没有抓住比赛。这是所有感兴趣的人的工作配置:
.hgsub:
Turns out I think I was testing at a different repo so it wasn't grabbing the match. Here's the working config for all those interested:
.hgsub:
您的
subpaths
配置似乎不正确。左侧的字符串必须是与.hgsub
中的条目匹配的模式。我认为您想要类似的内容:更多信息可以在以下位置找到:
:hg help 的 >subpaths
部分hgrc以下是
hgrc
帮助的摘录:It looks like your
subpaths
config is incorrect. The string on the left side must be a pattern that matches an entry in your.hgsub
. I think you want something like:More info may be found in:
subpaths
section ofhg help hgrc
:Here is an excerpt from the
hgrc
help: