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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Mar 15 11:28:57 EDT 2019

martinvonz added a comment.

  In https://phab.mercurial-scm.org/D6140#89400, @marmoute wrote:
  > I am a fan of this function, I need this on a regular basis. Having an 
  >  explicit function for this also open the way to various optimization. 
  >  For example we know that a set already has this property we could skip 
  >  all computation.
  > I am ambivalent about the naming however. It feels a bit odd. There are 
  >  case where it could be misleading.
  > Lets look at the following case:
  >   c e
  >   | |
  >   b d
  >   |/
  >   a
  > the revset `(b+c+d+e)::(b+c+d+e)` returns the same `b+c+d+e`, however 
  >  the set is not "contiguous" as `b+c` and `d+e` as not connected.
  Right, that's what I tried to express with "without adding new common ancestors or common descendants" in the documentation.
  > This feels a bit more like a "closure" operation to me.
  That's what I suggested on IRC because the operation somehow made me think of a closure, but when I looked up what a closure is, it seems like `ancestors()` is the actual closure function (if we consider the direction to point from child to parents as we normally do).

  rHG Mercurial


To: martinvonz, #hg-reviewers
Cc: marmoute, mercurial-devel

More information about the Mercurial-devel mailing list