David Soria Parra <davi...@fb.com> writes: > # HG changeset patch > # User David Soria Parra <davi...@fb.com> > # Date 1495905909 25200 > # Sat May 27 10:25:09 2017 -0700 > # Node ID 47c710c797624b6d5c84c493a873ea8beb563a74 > # Parent b647b923486f38d83b92089eafa9faafaa79785d > revset: lookup descendents for negative arguments to ancestor operator > > Negative offsets to the `~` operator now search for descendents. The search is > aborted when a node has more than one child as we do not have a definition for > 'nth child'. Optionally we can introduce such a notion and take the nth child > ordered by rev number. > > The current revset language does provides a short operator for ancestor lookup > but not for descendents. This gives user a simple revset to move to the > previous > changeset, e.g. `hg up '.~1'` but not to the 'next' changeset. With this > change > userse can now use `.~-1` as a shortcut to move to the next changeset. > This fits better into allowing users to specify revisions via revsets and > avoiding the need for special `hg next` and `hg prev` operations.
Thanks for picking this back up! Back in the day, I had an idea for this that was: x^-1 (first child), x^-2 (second child; ordered by rev num) since that seems to be symmetric to what we have now. x^-1^-1 would then be equivalent to x~-2. This eventually all got derailed before and during the last London sprint when mpm suggested the following: (added to https://www.mercurial-scm.org/wiki/RevsetOperatorPlan) http://markmail.org/message/sjnnwa43s4eksu62 Nothing ever came of it but it might provide some insight into previous pitfalls.
signature.asc
Description: PGP signature
_______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel