Search code examples
mercurial

hg revision specifier for Nth entry in the obslog? (evolve extension)


I'm using Mercurial with the evolve extension. Is there a revision specifier that means "the Nth first parent in the obslog for revision X"?

After I rebase a commit I would like to be able to quickly get the diff between the pre-rebased version of the commit and the post-rebased version. (Something similar to Git's @{1} revision specifier.)


Solution

  • You can reference the first parent in obslog (called precursor) by using the following revset: hg log -r "precursors(.)" --hidden. The problem is that you can have multiple precursors for a single revision.

    If you are sure you have a linear obsolescence history, you can access the Nth parent by calling precursors several times: hg log -r "precursors(precursors(.))".