How to show the diff specific to a named branch in mercurial

后端 未结 4 1185
青春惊慌失措
青春惊慌失措 2021-01-30 14:16

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

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


        
4条回答
  •  盖世英雄少女心
    2021-01-30 14:53

    Another way to do this, useful also for branches that you have already merged to default is:

    hg diff -r "max(ancestors(foo) and branch(default)):foo"
    

    Though that can be a pit of a pain, so i'd recommend setting up an alias by adding something like:

    [alias]
    branchdiff = diff -r "max(ancestors('$1') and branch(default)):'$1'"
    

    To your Mercurial.INI/hgrc which you can then use like this:

    hg branchdiff 
    

    or

    hg branchdiff .
    

提交回复
热议问题