Mercurial-忽略所有合并提交而查看分支上的更改 [英] mercurial - see changes on the branch ignoring all the merge commits

查看:64
本文介绍了Mercurial-忽略所有合并提交而查看分支上的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个开发了很长时间的分支.在开发过程中,默认分支多次合并到该分支中.我现在想回顾该分支上所有忽略合并的更改,以确定将其合并为默认值是否安全.

I have a branch that was developed for a long period of time. During the development default branch was merged into that branch several times. I would like now to review all the changes done on that branch ignoring merges, to decide whether it is safe to merge it to default.

我尝试了

hg diff -r "branch('myBranch') - merge()"

,但仍显示合并带来的更改.还尝试遵循此如何显示diff特定于Mercurial中的一个命名分支

but it still shows changes introduced by merges. Also tried following this How to show the diff specific to a named branch in mercurial but

hg diff -r "branch('myBranch') - branch('default')"

仍然带来合并带来的更改.

still bring changes introduced by merges.

推荐答案

命令的问题是,当您执行hg diff并将其传递给多个变更集时,您实际上在这些变更集之间进行了区分,因此您将看到合并结果.

The problem with your commands is that when you perform a hg diff and pass it several changesets, you actually perform a diff between those changesets, hence you will see the merge result.

如果只想查看更改集所做的更改,则可以使用export:

If you want to see just the changes made by the changesets then you could use export:

$ hg export -r "branch('mybranch') and not merge()"
// lists the changes made by each changeset

为便于查看,您可以将它们输出到具有基于修订/变更集ID的名称的文件:

For easier reviewing, you can output these to files with names based on the revision/changeset id:

$ hg export -r "branch('mybranch') and not merge()" -o "%H.patch"

...为mybranch中的每个非合并变更集创建一个文件,并将其输出到名称为"40位变更集id.patch"的文件.如果您希望使用修订号(仅对本地存储库有用,因为修订ID是本地的),请使用"%R.patch".

... creates a file for each non-merge changeset in mybranch, and outputs it to a file with the name "40-digit changeset id.patch". If you'd prefer the revision number (only useful for your local repository as revision id's are local), use "%R.patch".

这篇关于Mercurial-忽略所有合并提交而查看分支上的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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