了解Mercurial合并变更集 [英] Understanding the Mercurial merge changeset

查看:103
本文介绍了了解Mercurial合并变更集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的仓库中有两个头,即C和D,它们具有B的共同父级,并且我先执行hg merge然后执行hg commit,那么该合并变更集中到底是什么?我试图了解我的工作hg diff -c xyz其中xyz是合并变更集的ID.

If I have two heads in my repo - C and D which have the common parent of B - and I do an hg merge then a hg commit, what exactly is in that merge changeset? I am trying to understand what I see what I do hg diff -c xyz where xyz is the id of the merged changeset.

更改集是否将显示在C和D中修改的所有文件的差异以及这些文件在公共父存储库B中存在的状态?

Will the changeset show the diffs of all files modified in C and D vs. the state of those files as they existed in the common parent repository B?

推荐答案

合并提交有两个父对象,因此在运行diff时,重要的是要了解要与哪个父对象进行比较.

A merge commit has two parents, so when running a diff it is important to understand which parent you are diffing against.

hg diff -c <changeset>显示更改集相对于第一个父项的差异.

hg diff -c <changeset> shows the diff of the changeset relative to the first parent.

来自 hg help diff :

diff可能会产生意外结果 用于合并,因为它将默认为 与工作进行比较 目录的第一个父更改集,如果 没有指定修订版本.

diff may generate unexpected results for merges, as it will default to comparing against the working directory's first parent changeset if no revisions are specified.

要与特定父级进行比较,最好同时提供合并更改集和相应父级的显式修订(例如hg diff -r <parent> -r <merge changeset>

To diff against a specific parent, it is best to provide the explicit revision of both the merge changeset and corrent parent (e.g. hg diff -r <parent> -r <merge changeset>

这篇关于了解Mercurial合并变更集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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