Starting with Mercurial 1.6.0, you can use revsets to find this:
hg log -r "ancestors(A) and branch(C)"
This shows all the ancestors of A that are on branch C. You can use templates to extract exactly the necessary information from the log entries.
See hg help revsets .
Niall C.
source share