在 Mercurial 中使用子存储库

发布于 2024-10-30 19:28:41 字数 754 浏览 4 评论 0原文

我有一个包含许多组件的大型系统,我想将其分布在几个不同的 Mercurial 存储库中(这样处理系统某些部分的人员就不必检查整个系统)。它需要同时在 UNIX 和 Windows 上运行。

在系统中,我有一个需要在许多地方共享的目录(包含 CSS 文件和图像等常见内容)。

我已经对其进行了设置,以便每个组件都有一个共享存储库的子存储库,并且该存储库也在更高级别上进行签出。我这样做是因为我希望程序员能够从主存储库中执行“hg pull”,而不是“hg Push”(任何更改都会通过“hgserve”从他们的工作中拉出,并在进行之前首先进行检查返回主存储库)。

因此,在顶层,程序员可以检查:

核心 风格 组件集A 组件集B 等等。

这些都指向 http://machine/hg/RepoName (通过克隆)。

我的子存储库位于:

ComponentSetA/web/style(其中 style = ../../Style in web/.hgsub) ComponentSetB/web/样式 我的问题

是,在“hg克隆”上,我似乎无法让子存储库自动创建自己。我希望它们是透明的。如果任何程序员没有进行更改,他们不应该注意到它们在那里......

如果我必须先检查样式存储库,然后执行其中一个组件,那就可以了,但我想要到顶级存储库的额外间接级别,允许程序员将其较低级别的更改推送到公共存储库中。

有什么建议吗?

I've got a big system with many components that I want to spread out over several different mercurial repositories (so people working on parts of the system don't have to checkout the entire system). It needs to work on both UNIX and Windows.

Within the system, I have one directory that needs to be shared in many places (holds common stuff like CSS files, and images).

I've set it up, so that each of the components has a subrepo to the shared repo, and that repo is also checked out at a higher level. I've done this because I want programmers to be able to do a 'hg pull' from the main repository, but not an 'hg push' (any changes get pulled by an 'hg serve' from their work and checked first before going back into the main repository).

So at the top level, a programmer can check out:

Core
Style
ComponentSetA
ComponentSetB
etc.

These all point back to http://machine/hg/RepoName (via clone).

And I have subrepos at:

ComponentSetA/web/style (with style = ../../Style in web/.hgsub)
ComponentSetB/web/style
etc.

My problem is that on an 'hg clone', I can't seem to get the subrepos to create themselves automatically. I'd like them to be transparent. If any of the programmers aren't making changes, they shouldn't notice that they are there...

It's OK if I have to check out the Style repo first, and then do one of the components, but I'd like the extra level of indirection to the top-level repo to allow programmers to push their lower-level changes into a common repo.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

流殇 2024-11-06 19:28:41

如果我错了,请纠正我,但听起来您在 web 子目录中有一个 .hgsub 文件,而不是在存储库的根目录中。如果您希望 web/style 成为子存储库,请将其添加到根 .hgsub 中,如下所示:

web/style = ../../Style

Correct me if I'm wrong, but it sounds like you have a .hgsub file in a web subdirectory and not in the root of the repo. If you want web/style to be a subrepo, you add it to your root .hgsub like this:

web/style = ../../Style
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文