如何使用Mercurial同步同一工具的封闭和开放源代码版本? [英] How can I synchronize closed and open sourced versions of the same tool using Mercurial?

查看:92
本文介绍了如何使用Mercurial同步同一工具的封闭和开放源代码版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个想要发布源代码的工具.但是,由于许可限制,一些功能不能作为开源部件发布.我通常希望使用代码的开源版本来开发工具本身,但是在每个发行版中,我都需要将封闭版本中的一些功能移植回特定客户端的版本中.

我不能为此使用普通分支,因为那样会将封闭的源代码放入与我要共享开放代码的位置相同的存储库中(在本例中为Bitbucket).

我能做些什么吗?还是我不得不手动移动源代码?

解决方案

是否可以将秘密位隔离到插件/插件中(可以通过构建或运行时配置启用),并将代码库拆分为两个存储库,一个用于存储库.开源版本(以及封闭版本的基础)和封闭版本的补充?

这样,封闭源构建仍将使用相同的存储库,但会从秘密的第二代码库中添加一些额外的内容.构建过程将类似于外部上游库的构建过程.

I have a tool I would like to release the source to. However, a few features cannot be released as open source parts because of licensing restrictions. I'd like to generally develop the tool itself using the open source version of the code, but at each release I need to port the few features in the closed version back into the build for a particular client.

I can't just use a normal branch for this, because that would put the closed source bits into the same repository as where I'd like to share the open code (in this case, Bitbucket).

Is there anything I can do or am I stuck with manually moving source around?

解决方案

Can you segregate the secret bits into plugins/addons (something that can be enabled by build or runtime configuration) and split the codebase into two repositories, one for the open source edition (and also the base for the closed-source edition), and one for the closed-source additions?

This way, the closed-source build would still use the same repository, but add some extra stuff from the secret second code base. The build process would be similar to the one for an external upstream library.

这篇关于如何使用Mercurial同步同一工具的封闭和开放源代码版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆