在开发与开发之间水银生产 [英] Going between development & production in Mercurial

查看:89
本文介绍了在开发与开发之间水银生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用了一段时间了,但是还没有真正习惯使用分支机构,因此在将其应用于实际项目之前,我一直在努力弄清这个工作流程是否有意义.

I've used mercurial for some time now, but haven't really gotten used to working with branches, so I am struggling to figure out whether this workflow makes sense or not before applying it to a real project.

问题:
每次我们要通过将production合并到新版本中来重新开发development分支真的有意义吗,还是我们应该改用像development-1.1这样的唯一命名的短期开发分支?

The question:
Does it really make sense to resurrect a development branch every time we're going to work on a new release by merging production into it, or should we instead make unique named short-lived development branches like development-1.1?

工作流程说明:
我们的代码的每个生产就绪修订版都将被标记(1.01.1等),并放置在production分支中.将1.0投入生产后,我们立即开始开发下一个版本-1.1,方法是打开一个名为development的分支,然后由每个开发人员为每个分配的功能对其进行分支,以保留所有功能.整洁的.到目前为止非常简单.

Description of workflow:
Every production-ready revision of our code will be tagged (1.0,1.1 and so on) and placed in the production branch. As soon as we've put 1.0 into production, we immediately start working on next release - 1.1, by opening a branch named development, which is then sub-branched by every developer for every assigned feature to keep things neat. Very straightforward this far.

development分支(现在包含合并的feature分支),然后进行测试,然后将其合并回production,因为这些更改已被认为可以投入生产.

The development branch, now containing the in-merged feature branch, is then tested and merged back into production as the changes have been considered production-ready.

当我们需要继续处理即将发布的版本时,在本例中,为1.2,我们将production分支合并为development并开始工作.

When when we need to continue working on an upcoming release, 1.2 in this example, we merge the production-branch into the development one and start working.

修订版本的历史记录:

@    changeset:   8:21e89b501d4e
|\   branch:      development
| |  tag:         tip
| |  description: Development stage for v1.2 opened by merging production into development.
| |
| o  changeset:   7:920ca77aa956
|/|  branch:      production
| |  tag:         1.1
| |  description: Version 1.1 stable (merged from development).
| |
o |    changeset:   6:691b7aa99e42
|\ \   branch:      development
| | |  description: Feature merged in to development
| | |
| o |  changeset:     5:5156cb9cf556
| | |  branch:        feature
| | |  description:   Feature finished
| | |
| o |  changeset:     4:0345dc73e144
|/ /   branch:        feature
| |    description:   Work started on a feature
| |
o |  changeset:    3:9d49be5d8a03
|/   branch:       development
|    description:  Development branch opened
|
o  changeset:     2:ba818420fa88
|  branch:        production
|  tag:           1.0
|  description:   Version 1.0 stable. Woop woop!

推荐答案

带有Mercurial的命名分支是永远的,因此,一般建议是仅将它们用于始终适用的名称.诸如稳定"和开发"之类的东西,而不是诸如"bug-194534"和"release-1.1"之类的东西.在Wiki中对此进行了很好的解释.

With Mercurial named branches are forever, and thus the general advice is to only use them for names that always apply. Things like "stable" and "development", not things like "bug-194534" and "release-1.1". This is explained nicely in the wiki.

对于寿命有限的事物,最好使用诸如书签之类的东西,它们比git称为分支的东西要远多于Mercurial命名的分支.短期概念的其他绝佳选择是匿名分支克隆,它们都是非永久性的.

For things that have finite lifespans you're better off using something like bookmarks which are much closer to what git calls branches than are Mercurial named branches. Other great options for short-lived concepts are anonymous branches or clones, both of which are non-permanent.

一般建议是使用 default 作为您的开发分支,但总而言之,,请继续重复使用同一分支进行开发.

The general advice is to use default as your development branch, but in brief, yes, keep reusing your same branch for development.

这篇关于在开发与开发之间水银生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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