D6140: revset: add new contiguous(x) function for "x::x"

Josef 'Jeff' Sipek jeffpc at josefsipek.net
Wed Mar 20 09:04:58 EDT 2019

On Fri, Mar 15, 2019 at 05:27:46 +0000, martinvonz (Martin von Zweigbergk) wrote:
>   "x::x" is a useful trick for making a range contiguous, but it gets
>   annoying if "x" is a long expression. Let's provide a simple function
>   that helps with that. It also makes it the trick more discoverable.
> + at predicate('contiguous(set)', safe=True, takeorder=True)
> +def contiguous(repo, subset, x, order):
> +    """Changesets that have both ancestors and descendants in the set. This
> +    effectively fills in gaps in the set to make it contiguous, without adding
> +    new common ancestors or common descendants.
> +
> +     "contiguous(x)" is identical to "x::x".

I read this doc string and the patch intro several times, and every time I
concluded that this function was useless.  Only after reading some of the
other replies, did I realize that "x" here can be a set.

Therefore, technically, the above is correct.  Practically, if you are a
mere mortal and you aren't used to very advanced revsets, the doc string
will make you go "huh?".  I don't have a good suggestion how to improve it,
I just thought I'd point out that it's a bit...opaque to more novice users.

I agree that the name isn't the best, but I'll stay away from this bike shed


> +    """
> +    return dagrange(repo, subset, x, x, order)
> +
>  @predicate('converted([id])', safe=True)
>  def converted(repo, subset, x):
>      """Changesets converted from the given identifier in the old repository if
> To: martinvonz, #hg-reviewers
> Cc: mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former.
		- Albert Einstein

More information about the Mercurial-devel mailing list