Mercurial:两个独立的存储库有些相关(是的,我很困惑)
我有一个本地存储库,我们称其为“ONE”。一个是实际的程序。 这是一个 Android 程序,以防它因某种原因而重要。
我有一个远程存储库,我们将其称为 EXT。 EXT 在某种程度上是一个库,由 ONE 使用。
ONE 有一个复杂的目录结构,由 android 强制执行。主要来源位于src/bla/bla/ONE
。由于 ONE 使用 EXT,为此我必须在该目录旁边创建另一个目录,即 src/bla/bla/EXT。
我认为希望将它们分开存放在两个存储库中,但我需要它们实际上位于同一目录结构中才能编译一个。
目前我刚刚创建了一个符号链接来执行此操作,但我想知道是否有更好的方法来执行此操作,即使用一些 hg 功能。
I have a local repository, let's call it ONE. ONE is the actual program. It's an android program, in case it matters for some reason.
I have a remote repository, let's call it EXT. EXT is somewhat a library, used by ONE.
ONE has a complex directory structure, mandated by android. The main sources are in src/bla/bla/ONE
. Since ONE uses EXT, to do it I had to create another directory next to that one, that is src/bla/bla/EXT
.
I think would like to keep them separated in two repositories, but I need for them to actually be in this same directory structure to compile ONE.
At the moment I just created a symlink to do it, but I wonder if there is a better way of doing that, that uses some hg feature.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
子存储库非常适合于此。看看 这个相关的SO问题:(如何将子存储库添加到mercurial中的现有存储库中。
Subrepositories are great for this. Take a look at this related SO question: (how do I add a subrepo to an existing repo in mercurial.
我不是这方面的专家,但我认为子存储库在这种情况下不起作用。
您有 2 个具有相同深层嵌套目录结构的项目:
项目“ONE”:
项目“EXT”
当您编译这些项目时,您需要以下结构:
或类似的结构 - 本质上两个源树都组合在单个“src”下。
由于您无法签出存储库的一部分,因此无论您在何处创建子存储库,您都将获得完整的“EXT”目录。因此,如果您在“ONE”旁边创建一个子存储库,您最终会得到:
您所追求的是“部分克隆”,它尚不存在。
https://www.mercurial-scm.org/wiki/PartialClone
我认为操作系统链接是要走的路。
希望这有帮助。
I'm no expert on this, but I don't think sub-repositories work in this case.
You have 2 projects with the same deeply nested directory structure:
Project "ONE":
Project "EXT"
When you compile these projects you want the following structure:
Or something similar - essentially both source trees combined under a single "src".
Since you can't checkout part of a repository, wherever you create a sub-repository you'll get the full "EXT" directory. So, if you make a subrepo next to "ONE" you'll end up with:
What you are after is a "Partial Clone", which doesn't exist yet.
https://www.mercurial-scm.org/wiki/PartialClone
I think OS links are the way to go.
Hope this helps.
使用 hg 子存储库。例如:
Use hg subrepos. For example: