Mercurial 1.4.x 中的 subprepos 功能是否适合生产使用?

发布于 2024-08-20 15:55:12 字数 422 浏览 13 评论 0原文

我想针对我的工作项目评估 Mercurial。但我的大多数项目都非常依赖 svn:externals 之类的支持。我在 StackOverflow 上进行了搜索,并在 Google 上搜索了 Mercurial 中的相应支持。我发现的只是 Mercurial 1.3 中添加的 subrepo 功能,但是此功能的页面说:

子存储库是 Mercurial 1.3 的一项实验性功能。因此,不要在关键任务存储库上执行此操作!

我不想使用不稳定的东西。

任何人都可以阐明此功能的真实状态,以及完善/完成它的计划,以及何时将其称为“稳定”并为关键任务存储库做好准备?

I'd like to evaluate Mercurial for my working projects. But most of my projects very heavily rely on the presence of svn:externals-like support. I've searched over StackOverflow and googled for corresponding support in Mercurial. All I found is subrepo feature added in Mercurial 1.3, but the page for this feature said:

subrepos are an experimental feature for Mercurial 1.3. So don't do this on mission critical repositories!

I don't want to use something unstable.

Can anybody shed some light on the real status of this feature, and the plans of polishing/finishing it and when it will be called "stable" and ready for mission critical repositories?

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

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

发布评论

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

评论(2

二智少女 2024-08-27 15:55:12

#mercurial IRC 频道中的说法是,子存储库将继续像以前一样工作,并且支持将会增长。例如,目前“hg status”命令无法识别子存储库——它可以工作,只是不会递归,但将来它会的。但是,当前的行为、文件格式(.hgsub 和 .hgsubstate)只会以向后兼容的方式进行更改。

所以,现在就继续相信它,并期待它变得更好。

PS 从 Mercurial 1.4.2 开始,子存储库现在可以是 Subversion 存储库,因此您可以使用 Mercurial 父级和 svn 子级。

The word in the #mercurial IRC channel is that subrepos will continue to work as they do, and support will grow. For example currently the 'hg status' command isn't subrepo aware -- it works, it just doesn't recurse, but that in the future it will be. However, the current behaviors, fileformats (.hgsub and .hgsubstate) will only be changed in backward compatible ways.

So, go ahead and count on it now, and look forward to it getting better.

P.S. As of mercurial 1.4.2 the subrepos can now be subversion repos, so you can use a mercurial parent and a svn kid.

山色无中 2024-08-27 15:55:12

到目前为止,我在(轻度)使用该功能时运气很好。它在两个地方派上用场:

  1. 使用单个 hg pull 命令备份不相关存储库的树。
  2. 将项目与其依赖项的特定版本捆绑在一起,以便单个 hg 克隆 获得可构建的源代码。这更接近典型的 svn:externals 用法。

以下是我迄今为止看到的一些限制:

  1. 对于上面的情况 #1,您必须立即提交所有子存储库。这只是偶尔令人烦恼,因为 Mercurial(与任何 DVCS 一样)鼓励频繁提交,因此大多数存储库一开始就不会处于不完整状态。
  2. 只有最基本的 Mercurial 命令是子存储库感知的:clonepush / pullupdate / 提交,也许还有其他一些。
  3. 扩展作者将需要时间来针对具有子存储库的存储库测试他们的扩展。

当 Mercurial 团队将该功能描述为“实验性”时,他们并不意味着它会突然决定删除您的所有数据。它们只是意味着他们没有围绕名称冲突等所有边缘情况进行编码(例如,一个开发人员添加了一个名为 README 的子存储库,而另一位开发人员添加了一个名为 README 的文本文件>)。

I've had good luck with the feature in my (light) usage of it so far. It's come in handy in two places:

  1. Backing up a tree of unrelated repositories with a single hg pull command.
  2. Tying a project together with specific versions of its dependencies, so that a single hg clone gets buildable source code. This is closer to the typical svn:externals usage.

Here are a couple of the limitations I've seen with it so far:

  1. In case #1 above, you have to commit all subrepos at once. This is only occasionally annoying, as Mercurial (like any DVCS) encourages frequent commits—so most repos aren't left sitting around in an incomplete state to begin with.
  2. Only the most basic Mercurial commands are subrepo-aware: clone, push / pull, update / commit, and perhaps a couple of others.
  3. Extension authors are going to need time to test their extensions against repositories with subrepos.

When the Mercurial team describes the feature as "experimental," they don't mean that it's suddenly going to decide to erase all your data. They just mean that they haven't coded around all the edge cases like name conflicts (e.g., one developer adds a subrepo called README, while another developer adds a text file called README).

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