如何在Mercurial中显示特定于命名分支的差异 [英] How to show the diff specific to a named branch in mercurial

查看:47
本文介绍了如何在Mercurial中显示特定于命名分支的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个命名分支foo,其中有两个提交a,b:

Assuming I have a named branch foo with two commits a, b:

      a       b       c  
------o-------o-------o------- # default
       \          d         e
        ----------o---------o  # branch foo

我想查看a和e(不包括a)之间的差异.我当然可以使用修订版ID,但这不是很实际.在git中,可以只做git diff master..foo.我如何在hg中做同样的事情?

I want to see the diff between a and e (a not included). I could of course use the revision id, but that's not very practical. In git, one can just do git diff master..foo. How can I do the same in hg ?

推荐答案

您可以使用 revsets进行操作.

在您的特定示例中,我认为您可以使用以下命令获取仅de的列表:

In your specific example I think you could get a list of of just d and e using:

hg log -r "branch('foo') - branch('default')"

其中-定义为:

"x - y"
      Changesets in x but not in y.

获取从a到e的差异可以通过以下方式完成:

Getting the diff from a to e could be done as:

hg diff -r "ancestor(default, foo)" -r foo

尽管我可能没有看到它的简写形式.

though there's possibly a shorthand for that I'm not seeing.

这篇关于如何在Mercurial中显示特定于命名分支的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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