如何使用两个 Mercurial 存储库处理两个项目变体?

发布于 2024-10-18 20:40:27 字数 667 浏览 1 评论 0原文

我们有一个开源应用程序,并以 GPLv2 形式发布。我们还有一个略有不同的版本,带有商业许可证。两种变体之间的差异非常有限。

我们有一个用于 GPL 应用程序的主要 Mercurial 存储库。

我希望能够为商业应用程序保留一个单独的存储库(主要的存储库是公开的),但我也希望能够定期“推送”对其进行更改(但不是相反)。考虑这些存储库托管在托管 Web 服务的项目上。

到目前为止我所做的:

  1. 创建了一个新的comm存储库
  2. 提交了商业应用程序的第一个版本(没有历史记录)
  3. comm推送到远程托管
  4. 修改开源 存储库
  5. 尝试从开源推送到远程comm,hg 表示存储库不相关
  6. 尝试从*开源'*推送到 comm 带有 -f(强制)选项,hg 现在只显示警告

步骤 6 的问题是我会将所有变更集推送到 comm 存储库,这是不正确的。我基本上想从给定的时间点开始推送更改(非常类似于合并两个 SVN 分支)。

我正在学习 hg移植 扩展,但定期使用似乎有点复杂。

我是 Mercurial 的新手,所以我可能做错了,所以还请建议解决相同问题的其他方法。

We have an application, which is open-source and published as GPLv2. We also have a slightly different version, with a commercial license. The differences between the two variations are very limited.

We have a main Mercurial repo for the GPL application.

I want to be able to keep a separate repo for the commercial application (the main one is public), but I also want to be able to regularly "push" changes to it (but not the other way round). Consider that these repos are hosted on a project hosting web service.

What I have done so far:

  1. created a new comm repo
  2. committed a first version of the commercial app (no history)
  3. pushed comm to remote hosting
  4. Modified open-source repo
  5. tried to push from open-source to remote comm, hg says the repos are unrelated
  6. tried to push from *open-source'*to comm with -f (force) option, hg now just shows a warning

The problem with step 6 is that I would push ALL changesets to the comm repo, which is not correct. I basically want to push changes since a given point in time (very much like merging two SVN branches).

I'm learning about the hg transplant extension, but that seems to be a bit complex to use on a regular basis.

I am new to Mercurial, so I might be doing it wrong, so please also suggest other ways of solving the same problem.

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

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

发布评论

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

评论(1

陌上芳菲 2024-10-25 20:40:28

使用像 Mercurial 这样的分布式版本控制系统,您可以在步骤 1 中克隆源存储库,并在起始点有两个具有相同内容的存储库,即 open-sourcecomm,如下所示你打电话给他们。您将在 comm 存储库中进行初始更改。随着开源存储库中开发的进展,您会定期将更改拉入comm存储库,并将这些更改与那里的更改合并。这将在 comm 存储库中生成额外的合并变更集。只要您不将它们推回开源存储库,您就不会在那里看到它们,它们也不应该打扰那里,但这就是我理解您想要的。

With a distributed version control system like mercurial you would clone the source repository in step 1 having two repositories with the same content at the starting point, namely open-source and comm as you called them. You would do your initial changes in your comm repository. As development proceeds in the open-source repo you would regularly pull changes into the comm repository and merge these with the changes there. This will produce additional merge changesets in the comm repo. As long as you don't push them back to the open-source repo you won't see them there and they should not disturb there, but that's what I understood you wanted anyway.

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