[PATCH 7 of 7] revset: add startdepth limit to ancestors() as internal option

Martin von Zweigbergk martinvonz at google.com
Fri Jun 23 14:19:03 EDT 2017


On Thu, Jun 22, 2017 at 8:52 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1497714058 -32400
> #      Sun Jun 18 00:40:58 2017 +0900
> # Node ID 043c544c05570f88a8e39bc7a7ea5ba0db616a62
> # Parent  055c465c0bb153c4d595a3c476f2e448c1d2d35b
> revset: add startdepth limit to ancestors() as internal option

Queued this, thanks.

>
> This is necessary to implement the set{gen} (set subscript) operator. For
> example, set{-n} will be translated to ancestors(set, depth=n, startdepth=n).
>
> https://www.mercurial-scm.org/wiki/RevsetOperatorPlan#ideas_from_mpm
>
> The UI is undecided and I doubt if the startdepth option would be actually
> useful, so the option is hidden for now. 'depth' could be extended to take
> min:max range, in which case, integer depth should select a single generation.
>
>   ancestors(set, depth=:y)  # scan up to y-th generation
>   ancestors(set, depth=x:)  # skip until (x-1)-th generation
>   ancestors(set, depth=x)   # select only x-th generation
>
> Any ideas are welcomed.

I also don't see the point of startdepth, but I have never even missed
stopdepth myself so maybe I'm not the right person to ask.


More information about the Mercurial-devel mailing list