Mercurial:两个独立的存储库有些相关(是的,我很困惑)

发布于 2024-09-04 02:20:12 字数 381 浏览 3 评论 0原文

我有一个本地存储库,我们称其为“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 技术交流群。

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

发布评论

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

评论(3

浅浅 2024-09-11 02:20:13

我不是这方面的专家,但我认为子存储库在这种情况下不起作用。

您有 2 个具有相同深层嵌套目录结构的项目:

项目“ONE”:

ONE
    /src
        /bla
            /bla
                /ONE

项目“EXT”

EXT
    /src
        /bla
            /bla
                /EXT

当您编译这些项目时,您需要以下结构:

Compile Project
    /src
        /bla
            /bla
                /ONE
                /EXT

或类似的结构 - 本质上两个源树都组合在单个“src”下。

由于您无法签出存储库的一部分,因此无论您在何处创建子存储库,您都将获得完整的“EXT”目录。因此,如果您在“ONE”旁边创建一个子存储库,您最终会得到:

Combined Project
    /src
        /bla
            /bla
                /ONE
                /src
                   /bla
                       /bla
                           /EXT

您所追求的是“部分克隆”,它尚不存在。

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":

ONE
    /src
        /bla
            /bla
                /ONE

Project "EXT"

EXT
    /src
        /bla
            /bla
                /EXT

When you compile these projects you want the following structure:

Compile Project
    /src
        /bla
            /bla
                /ONE
                /EXT

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:

Combined Project
    /src
        /bla
            /bla
                /ONE
                /src
                   /bla
                       /bla
                           /EXT

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.

挽容 2024-09-11 02:20:13

使用 hg 子存储库。例如:

$ git init ONE-proj
$ cd ONE-proj
$ mkdir -p src/bla/bla/ONE
$ ... # commit your initial project files for ONE
$ echo src/bla/bla/EXT = /path/to/hg/repository/EXT > .hgsub
$ hg add .hgsub
$ hg clone /path/to/hg/repository/EXT src/bla/bla/EXT
$ hg commit

Use hg subrepos. For example:

$ git init ONE-proj
$ cd ONE-proj
$ mkdir -p src/bla/bla/ONE
$ ... # commit your initial project files for ONE
$ echo src/bla/bla/EXT = /path/to/hg/repository/EXT > .hgsub
$ hg add .hgsub
$ hg clone /path/to/hg/repository/EXT src/bla/bla/EXT
$ hg commit
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文