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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Mar 20 13:24:07 EDT 2019


martinvonz added a comment.


  Josef 'Jeff' Sipek <jeffpc at josefsipek.net> sent this to mercurial-devel. I'm adding it here for reference.
  
  >   "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
  :)
  
  Jeff.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6140

To: martinvonz, #hg-reviewers
Cc: mharbison72, yuja, av6, spectral, gracinet, marmoute, mercurial-devel


More information about the Mercurial-devel mailing list