使用 TortoiseHg 运行更新时强制警告有关交叉分支的警告
当在命令行上从 Mercurial 存储库获取最新代码时,如果有需要合并的变更集,Mercurial 会发出警告:
hg up
abort: crosses branches (merge branches or use --check to force update)
这就是我所期望的,并且从 Mercurial 书中它说“Mercurial 告诉我们 hg 更新命令不会进行合并;当它认为我们可能想要进行合并时,它不会更新工作目录,除非我们强制它这样做。”此时我知道我需要合并。
如何使用 TortoiseHg 获得相同的行为?当我点击“更新”时,它很高兴地将我更新到最新的变更集。有没有办法警告我可能需要合并? “始终合并(如果可能)”选项似乎仅在您有未提交的更改时才适用。
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)
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.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您在命令行上从
hg update
收到错误的原因是它不知道要选择哪个版本。有 2 个不同的默认头。如果您要执行
hg update -r
,该命令将完成且不会出现错误。使用 TortoiseHg 时,您可以通过以下方式进行更新:
Update...
这将转换为
hg update -r
,因此不会出现错误。使用 TortoiseHg,您始终可以看到修订图。该图显示了新拉取的变更集何时创建新头。
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.If you were to execute
hg update -r <specific rev>
, the command completes without error.When using TortoiseHg, you update by:
Update...
This translates to
hg update -r <rev>
, so there is no error.Using TortoiseHg, you always have the revision graph in front of you. The graph shows when newly pulled changesets create a new head.
您看到的 Mercurial 中止正在发生,因为您的工作目录中有未完成的(即:未提交的)更改,正在尝试执行更新,并且 Mercurial 决定您可能应该执行合并。
TortoiseHg 也应该警告您这一点,但它会以不同的方式警告您。它将生成一个对话框,询问您是否要放弃、合并或搁置未完成的更改。这就是 TortoiseHg v2.XX 中的样子,但在 v1.1.X 中应该类似:
如果您在 TortoiseHg 中没有看到这一点,则可能没有任何显着的更改。再试一次 - 您看到这些选项了吗?
The Mercurial abort you are seeing is occurring because you have outstanding (ie: non-committed) changes in your working directory, are trying to perform an update, and Mercurial has decided that you should probably perform a merge instead.
TortoiseHg should also warn you about this, but it will do so in a different way. It will spawn a dialogue that asks if you want to Discard, Merge, or Shelve your outstanding changes. This is what it looks like in TortoiseHg v2.X.X, but it should be similar in v1.1.X:
If you're not seeing this in TortoiseHg, you may not have any outstanding changes. Try it again - are you seeing these options?