How to find out if a changeset contains another changeset?

Matt Mackall mpm at selenic.com
Wed Mar 19 10:49:38 CDT 2008


On Wed, 2008-03-19 at 14:18 +0100, Peter Weseloh wrote:
> Hi,
> basically the subject says it already: Is there a simple way in
> Mercurial to find out if a changeset is in the parent list (following
> merges) of another changeset?
> Background is that I have a executable and I know the changeset sha id
> it was build from. Now I want to know if a certain feature/bugfix
> (from which I also know the sha id ) is in the exe. I was able to find
> this out using 'hg view' but due to many branches/merges this was
> quite complicated.
> With the changesets forming a DAG this question should be simple to
> answer, right? Unfortunately I could not find a command or simple
> combination of commands to do this. Any ideas?

With the latest hg, you can do:

$ hg debugancestor 540 533
533:b8404005d6d5345c717fed50cc6c946f4faa8d45

That says, the common ancestor of revisions 540 and 533 is 533. That is,
540 is a direct descendant of 533.

In older hg, you had to explicitly tell it to use the changelog:

$ hg debugancestor .hg/store/00changelog.i 540 533
533:b8404005d6d5345c717fed50cc6c946f4faa8d45

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list