Mercurial-关闭默认分支,并用命名分支替换为新的默认分支 [英] Mercurial - close default branch and replace with a named branch as new default

查看:67
本文介绍了Mercurial-关闭默认分支,并用命名分支替换为新的默认分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个软件仓库中,默认"分支已经过时了,以至于不再需要合并开发"(已命名的分支,它具有应用程序的最新版本)中的更改.

In a mercurial repo, the "default" branch has fallen very out of date to the point where it no longer makes sense to merge in the changes from "develop", a named branch which has the latest deployed version of the application.

不是将develop合并为default,而是如何关闭当前的default分支,然后使用develop的头部创建一个新的default分支?

Instead of merging develop into default, how can I close the current default branch and then create a new default branch using the head from develop?

我还看到了一些其他类似的问题和答案,也许是相同的,但是我仍然很难理解它应该如何工作.

I've seen a few other questions and answers which are similar, perhaps the same, but I am still having trouble understanding how this should work.

谢谢!

推荐答案

如果defaultdevelop有所不同,并且您希望合并后defaultdevelop完全相同,则需要与Edward所提供的命令稍有不同(在developdefault的直接后代的情况下也可以使用).

If default has diverged somewhat from develop and you want default to be exactly the same as develop after the merge, you need a slightly different set of commands from what Edward gave you (this will also work where develop is a direct descendant of default).

hg update -C default
hg -y merge --tool internal:fail develop
hg revert --all --no-backup -r develop
hg resolve --all --mark
hg commit -m "merge updating default to current develop"

这意味着任何冲突都将导致无法解决的合并.然后,您将所有内容恢复为与develop分支上的内容相同(没有备份,因此不会剩下很多.orig文件).

This means that any conflicts will result in an unresolved merge. You then revert everything to be the same as on the develop branch (with no backup so you don't get lots of .orig files left over).

这篇关于Mercurial-关闭默认分支,并用命名分支替换为新的默认分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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