Mercurial:保持默认分支为“活动"状态. [英] Mercurial: keep default branch "active"

查看:94
本文介绍了Mercurial:保持默认分支为“活动"状态.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Mercurial与命名分支一起使用,请注意,当我创建默认分支的新分支时,default被标记为非活动分支.例如:

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" ?

推荐答案

活动"和非活动"分支的概念是我们在Mercurial项目中逐渐摆脱的.问题很简单,就像您刚刚看到的那样,分支可以在不方便的时间或多或少地在两个状态之间来回翻转.

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

$ hg update feature-branch
$ hg commit --close-branch -m "passes all tests, ready for merging"

这将添加一个特殊的变更集,该变更集将分支头标记为关闭.当分支上的所有头均关闭时,该分支本身被视为已关闭,并且将从hg branches中消失.我建议在合并前关闭 ,请查看我的命名分支指南,以获取更多示例.

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.

因此,我建议您将部署系统更改为显示打开的分支(hg branches)而不是活动分支(hg branches --active).

So I suggest you change your deployment system to show open branches (hg branches) instead of active branches (hg branches --active).

这篇关于Mercurial:保持默认分支为“活动"状态.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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