我可以在Mercurial中嵌套子广告吗? [英] Can I nest subrepos in Mercurial?
问题描述
目标:
我想像这样设置结构: / p>
- Build_Repo(此repo将用于跟踪依赖关系)
- Subrepo_A(这是主要来源)
- 模块(Subrepo_A的一部分)
- Subrepo_B
所以那里是三个回录:构建,A和B. B嵌套在A内,A嵌套在根构建存储库内。构建回购将用于跟踪依赖关系,subrepo A将用于跟踪主要源文件,而subrepo B(和其他)将用于跟踪模块/插件开发。
问题/问题
我没有问题设置初始构建回购和嵌套的Subrepo_A,只需将Subrepo_A路径和源添加到.hgsub文件并将其提交到构建回购。但是,当我将subrepo_B路径/源添加到构建回购的.hgsub后,然后尝试提交我收到错误消息:
abort:path'Subrepo_A / Modules / Sebrepo_B'内嵌嵌套的repo'Subrepo_A'
Mercurial似乎并不喜欢嵌套repo里面已经有一个嵌套的repo。这是真的吗,还是我错过了什么?关于如何管理构建/依赖的更好的想法?
这里的问题是Mercurial的不可避免的约束之一:计算机上的文件夹树。存储库负责该文件夹树下的所有内容。
当您的顶级存储库包含一个子存储库时,它会交给子存储完全控制其文件夹结构的一部分。因此,顶级别不能在第一个子资源夹中的某个地方指定另一个子存储库。
解决方案1
Subrepo_B实际上是Subrepo_A的依赖。在这种情况下,通过编辑Subrepo_A的.hgsub文件,在模块/ Sebrepo_B下添加Subrepo_B,使您的存储库反映真正的依赖关系。这是因为Subrepo_A保留对其文件夹的控制。
解决方案2
Subrepo_A不依赖Subrepo_B,为方便起见,您将其放在那里。在这种情况下,您应该使Subrepo_A和Subrepo_B成为Build_Repo的子目录(位于不同位置)。
I am having trouble setting up a project in Mercurial with subrepos.
Goal:
I want to set up the structure like so:
-- Build_Repo (this repo will be used to track dependencies)
-- Subrepo_A (this is the main source)
-- Modules (Part of Subrepo_A)
-- Subrepo_B
So there are three repos: Build, A, and B. B is nested inside A, A is nested inside the root build repository. The build repo will be used to track dependencies, subrepo A will be used to track the main source files, and subrepo B (and others) will be used to track module/plugin development.
Problem/Question
I have no problem setting up the initial build repo and the nested Subrepo_A by simply adding the Subrepo_A path and source to the .hgsub file and committing it to the build repo. However, when after I add the subrepo_B path/source to the build repo's .hgsub, and then try to commit I get the error message:
abort: path 'Subrepo_A/Modules/Sebrepo_B' is inside nested repo 'Subrepo_A'
Mercurial doesn't appear to like a nested repo inside an already nested repo. Is this true, or am I missing something? Any better ideas on how to manage builds/dependencies?
The problem here is one of Mercurial's inescapable constraints: a repository corresponds to a folder tree on your computer. The repository is responsible for everything under that folder tree.
When your top-level repository includes a sub-repository, it hands over to the sub-repo complete control of that part of its folder structure. So the top level can't specify another sub-repository somewhere in the first sub-repos folders.
Solution 1
Subrepo_B is actually a dependency of Subrepo_A. In that case, make your repositories reflect the true dependency by editing Subrepo_A's .hgsub file to add Subrepo_B under Modules/Sebrepo_B. This works because Subrepo_A retains control over its folders.
Solution 2
Subrepo_A doesn't depend on Subrepo_B, you were putting it there for convenience. In this case, you should make both Subrepo_A and Subrepo_B be subrepos (in different locations) of the Build_Repo.
这篇关于我可以在Mercurial中嵌套子广告吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!