在 Mercurial 中将 dev 分支合并/转换为稳定分支的正确方法是什么?
我在一家 Web 开发公司工作,该公司使用 Mercurial 作为其选择的 DVCS。我们目前正在为已投入生产的网站创建新版本。
站点的稳定和开发分支都存在于同一个存储库中。生产站点在稳定分支上运行,开发人员显然针对开发(从现在开始dev)分支进行编码(除了错误修复)。
这个模型对我们来说很新。在上次主要生产推送之后,我们从刚刚发布的稳定分支创建了开发分支(使用最新稳定修订版中的hg分支dev并承诺创建一个新的< em>提示)。
现在我们即将发布另一个版本,开发分支中存在大量新代码。与此同时,稳定分支只看到了错误修复,所有这些都已被移植到dev分支。
当我们对 dev 分支的状态感到满意并认为它已准备好生产时,我们希望 dev 分支的当前状态为成为新的稳定分支。只需轻轻一击,stable 分支就会吸收对 dev 分支所做的大量更改。 dev 分支(我们假设)基本上会变得不活动,直到我们再次开始开发新东西为止。
实际实现这一目标的正确过程是什么?从 dev 的提示进行简单合并,同时检查 stable 分支的提示,还是其他什么?正如我所说,对稳定的所有更改都已存在于dev中,因此我们可以让dev变得稳定 > 按原样。
一旦将dev神秘地转变为稳定并且结果已被标记,那么在dev上开始进一步开发的过程是什么再次分支,因为合并到稳定后,它不会有一个活动的提示来检查?只需检查合并之前的最后一个 dev 修订版本并在此基础上提交即可创建新的 tip?这似乎是错误的;我的直觉告诉我,“新的开发”应该从合并后的项目中剥离出来。标记为 stable 分支的 tip,但我不知道这是如何完成的。 (如前所述,上次我们通过首先创建命名的 dev 分支来做到这一点;这次我们只想为现有分支创建一个新的 tip,尽管可能inactive-post-merge dev 分支)
对于任何更习惯分布式版本控制和 Mercurial 的人来说,这是一个简单的问题,但我们离开 SVN 领域并没有多久,事情仍然有点模糊。任何帮助表示赞赏。
I work for a web development company that uses Mercurial as its DVCS of choice. We're currently in the process of creating a new version of a site that is already in production.
Both a stable and a development branch of the site exist in the same repository. The production site runs off the stable branch, and developers obviously code against the development (dev from now on) branch (apart from bugfixes).
This model is quite new to us. After the last major production push, we created the development branch from the just-released stable branch (using hg branch dev from the latest stable revision and committing to create a new tip).
A significant amount of new code exists in the dev branch now that we're nearing another release. Meanwhile, the stable branch has only seen bugfixes, all that have been ported over to the dev branch already.
When we're satisfied with the state of the dev branch and deem it production-ready, what we'd like is for the then-current state of the dev branch to become the new stable branch. In one swift stroke, the stable branch would assimilate the tons of changes that have been made to the dev branch. The dev branch would (we assume) essentially become inactive, until such a time that we start developing new stuff again.
What is the correct process for actually achieving this? A simple merge from the tip of dev while having the tip of the stable branch checked out, or something else? As I said, all changes to stable already exist in dev, so we're okay with dev just becoming stable as-is.
And once the mystical transmogrification of dev into stable has been done and the result has been tagged, what's the process of beginning further development on the dev branch again, since after a merge into stable it won't have an active tip to check out? Just check out the last dev revision prior to the merge and commit on top of that to create the new tip? That seems wrong; my gut instinct tells me that the "new dev" should be spun off of the merged & tagged tip of the stable branch, but I don't know how that's done. (As said, last time we did this by creating the named dev branch in the first place; this time we just want to create a new tip to the existing, though probably inactive-post-merge dev branch)
Simple questions to anyone who is more accustomed to distributed version control and Mercurial, but it's not too long since we left SVN-land and things are still a bit hazy. Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果开发分支包含您对稳定分支所做的所有添加,并且开发分支已准备好成为新的稳定分支,则您可以只分支开发分支的新稳定分支。旧的稳定分支可以保留下来,以防遗留代码的用户需要修补程序。
If the development branch has all additions you've made to your stable branch, and the development branch is ready to be the new stable branch, you could just branch a new stable branch of the development branch. The old stable branch could be kept around as is in case users of the legacy code need a hotfix.
我会:
这将允许您在 dev 分支中解决在 dev 分支生命周期期间在稳定分支上进行的错误修复可能发生的任何最后冲突。
I would:
That will allow you to solve in the dev branch any last conflicts which may occurs with the bug-fixes made on stable branch during the dev branch lifetime.
不是您问题的直接答案,但此处有一个关于 Mercurial 的优秀教程。本教程以非常简单的方式解释了合并。我发现读完这本书后我比任何其他书都更了解 Mercurial。
Not a direct answer to your question but an excellent tutorial on mercurial exists here. This tutorial explains merging in a very simple way. I have found that I understood Mercurial better after reading this than any other book.