Mercurial:保持默认分支“活动”
我将 Mercurial 与命名分支一起使用,请注意,当我创建新的 default 分支时,default 被标记为非活动分支。例如:
C:\data\solutions\test-repo>hg branches
default 0:aeec280e6310
C:\data\solutions\test-repo>hg branch feature-branch
marked working directory as branch feature-branch
C:\data\solutions\test-repo>hg com -m "created new branch"
C:\data\solutions\test-repo>hg branches
feature-branch 1:1cb18d7fa554
default 0:aeec280e6310 (inactive)
这是一个问题,因为我们的部署系统显示了活动的命名分支,可以从中进行部署。
如何使我的默认分支保持“活动”状态?
I am using mercurial with named branches, and notice that when I create a new branch of default, default is marked as an inactive branch. Eg:
C:\data\solutions\test-repo>hg branches
default 0:aeec280e6310
C:\data\solutions\test-repo>hg branch feature-branch
marked working directory as branch feature-branch
C:\data\solutions\test-repo>hg com -m "created new branch"
C:\data\solutions\test-repo>hg branches
feature-branch 1:1cb18d7fa554
default 0:aeec280e6310 (inactive)
This is a problem because our deployment system shows named branches that are active, which can be deployed from.
How can I keep my default branch "active" ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们在 Mercurial 项目中正在放弃“活动”和“非活动”分支的概念。问题很简单,分支可以在不方便的时间或多或少随机地在两种状态之间来回翻转 - 正如您刚才所看到的。
相反,我们现在关注的是“开放”与“封闭”。这是一个明确的概念:要关闭分支头,您
需要添加一个特殊的变更集,将分支头标记为关闭。当分支上的所有头都关闭时,分支本身就被视为关闭,并将从
hgbranch
中消失。我建议在合并之前关闭,请查看我的命名分支指南以获取更长的示例。因此,我建议您更改部署系统以显示开放分支 (
hg Branches
),而不是活动分支 (hg Branches --active
)。The notion of "active" and "inactive" branches is something we're moving away from in the Mercurial project. The problem is simply that branches can flip back and forth between the two states more or less randomly and at inconvenient times — as you've just seen.
Instead, we're now focussing on "open" vs "closed". This is an explicit notion: to close a branch head, you do
That will add a special changeset that marks the branch head as closed. When all heads on a branch are closed, the branch itself it considered closed and will disappear from
hg branches
. I recommend closing before merging, please see my named branch guide for a longer example.So I suggest you change your deployment system to show open branches (
hg branches
) instead of active branches (hg branches --active
).不活动仅意味着它没有头。
在您的情况下,图表如下所示:
*
表示“工作目录”当您在功能中进行更多修复时(如节点 2 和 3),这将是一个方面:
当您想要集成
feature-branch
到default
只需更新到default
,然后将
feature-branch
合并到default< /code>:
它看起来“不活动”的事实并不意味着您 ”,也可以完美地工作。
例如,您的“部署脚本”可以有一个
hg update --clean default
,即使它显示为“非活动 合并后它将变为活动状态,并且功能分支将变为“非活动”状态,无需介意其活动/非活动状态,只需正常使用即可。
Inactive only means it has not a head.
In your case the graph is like this:
*
means the "working dirWhen you do more fixes in your feature (like nodes 2 and 3) this will be the aspect:
When you want to integrate
feature-branch
into thedefault
just update to thedefault
and then merge
feature-branch
into thedefault
:The fact that it appears "inactive" is not meaning you can't work with it. For example, your "deployment scripts" can have a
hg update --clean default
that will perfectly work even if it appeared as "inactive".Inactive just meant it had no heads. Nothing else. After merging it will become active and it will be
feature-branch
which will become "inactive".Don't mind its active/inactive state, just work with it normally.