About adding "successors" and "precursors" template keywords

Danek Duvall danek.duvall at oracle.com
Thu Feb 18 16:14:23 EST 2016


Durham Goode wrote:

> On 2/18/16 9:24 AM, Kostia Balytskyi wrote:
> >Hi guys,
> >
> >I would like to add "successors" and "precursors" template keywords to the
> >mercurial core. The motivation is clear: to allow people configure their
> >hg styles to display this if necessary (or even tweak the standard
> >mercurial log output if you think this is worth doing).
> >
> >The "successors" keyword will display a plain list of final successors,
> >e.g. for situation like a<-b<-c `hg log –r a` will not display b, only c.
> >What's more, it will display all the successors as a plain list, without
> >nesting. What I mean by that is if commit a is succeeded by b and
> >independently (c,d) (successorssets would return [(b,), (c,d)]), we will
> >just display "b,c,d", without any structure.
> >
> I feel like successors should be all the successors, and there should be
> some other term or function that can be used to get the final successors.
> Like "{final(successors)}".  You could also have a function for the first
> successors too "{initial(successors)}" (or something).

You can do this with the revset() function, if you have the evolve
extension enabled (which gives you the {all,}{precursors,successors}()
revsets):

    hg log --hidden -T "{rev}: {revset('allprecursors(%d)', rev)}\n"

Danek


More information about the Mercurial-devel mailing list