How to determine in Mercurial, if changeset, specified by revision, has already been grafted?

mercurial

Solution

This information is stored in the so-called "extra" dictionary inside the grafted changeset. This is a simple key-value mapping that you can see with `hg log --debug`.

The information is unfortunately not exposed as a revset predicate yet, so you'll have to do it the old-fashioned way: start with

$ hg --debug log -b branchX

to get the changesets on `branchX`. Then `grep` or otherwise search for lines matching

extra:       source=[0-9a-f]{40}

You could use the Mercurial bindings if you want a more high-level access. There are libraries for Java, Python, and Scala at the moment.

Problem

How can I see, if the changeset has already been grafted between branchX and default? I know, hg graft checks this for me, there I can't graft twice, but I want to list all changesets, which were not grafted between branchX and default. Thanks in advance for your answers.

Original source