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

后端 未结 4 1233
青春惊慌失措
青春惊慌失措 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:58

    You can do it using revsets.

    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')"
    

    where that - is defined as:

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

    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.

提交回复
热议问题