使用TortoiseHg运行更新时强制发出有关交叉分支的警告 [英] Force warnings about crossing branches when running Update using TortoiseHg

查看:100
本文介绍了使用TortoiseHg运行更新时强制发出有关交叉分支的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在命令行上从Mercurial存储库获取最新代码时,如果有需要合并的变更集,Mercurial会发出警告:

When getting the latest code from a Mercurial repo on the command line, if there are changesets that need to be merged Mercurial raises a warning:

hg up
abort: crosses branches (merge branches or use --check to force update)

这是我的期望,在Mercurial的书中,它说:"Mercurial告诉我们,hg update命令不会进行合并;当它认为我们可能想要执行以下操作时,它不会更新工作目录:合并,除非我们强迫它这样做."此时,我知道我需要合并.

This is what I expect, and from the Mercurial book it says "Mercurial is telling us that the hg update command won't do a merge; it won't update the working directory when it thinks we might want to do a merge, unless we force it to do so." At this point I know I need to merge.

如何使用TortoiseHg获得相同的行为?当我点击更新"时,它很高兴将我更新到最新的变更集.有没有办法警告我可能需要合并? 总是合并(如果可能)"选项似乎仅在您未提交更改时才适用.

How can I get the same behaviour using TortoiseHg? When I hit "Update", it happily updates me to the most recent changeset. Is there a way to warn me that a merge is probably needed? The "Always merge (when possible)" option seems to only apply when you have uncommitted changes.

推荐答案

在命令行上从hg update收到错误的原因是它不知道选择哪个修订版.有2个不同的默认标头.

The reason you get an error from hg update on the command-line is that it doesn't know which revision to pick. There are 2 divergent default heads.

如果要执行hg update -r <specific rev>,该命令将完成而不会出现错误.

If you were to execute hg update -r <specific rev>, the command completes without error.

使用TortoiseHg时,您可以通过以下方式进行更新:

When using TortoiseHg, you update by:

  1. 右键单击特定的变更集
  2. 选择Update...

这将翻译为hg update -r <rev>,因此没有错误.

This translates to hg update -r <rev>, so there is no error.

使用TortoiseHg,您总是可以看到修订图.该图显示了新提取的变更集何时创建新的记录头.

Using TortoiseHg, you always have the revision graph in front of you. The graph shows when newly pulled changesets create a new head.

这篇关于使用TortoiseHg运行更新时强制发出有关交叉分支的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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