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

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


martinvonz added a comment.


  In https://phab.mercurial-scm.org/D6140#89749, @mharbison72 wrote:
  
  > I've only used `X::X` where X was trivial, so I'm still trying to get my mind around this.  Out of curiosity, what are the scenarios where a nontrivial X is useful?
  
  
  It's only come up a few times for me. Most recently, it was @spectral who wanted to collapse merge commits. For example, if a graph merged A with B and then the result with C, we wanted to find A, B, and C. That could be achieved with `heads(contiguous(::x - x - merge()))` where `x` is some descendant.
  
  > I'm sure I've used the word "contiguous" when describing the `::` operator to people, but the case @marmoute referenced and even the `contiguous(9+3+4)` result don't match my expectations of the English word.
  
  I think we're still looking for English words where the behavior of this function would match expectations.
  
  > (For the latter, the 3 doesn't seem contiguous with the rest of the set.)
  
  I'm not sure which 3 you mean. 4 and 9 were made contiguous by the addition of 8, but 3 was a on different branch, so it wasn't. What the revset actually does is to include all commit that have both ancestors and descendants in the input set.
  
  >   FWIW, the first 3 words in the help for `::` is "A DAG range".
  
  Maybe it's just me, but I think it's a bit unfortunate if we describe `::` as "a DAG range" and then have a `dagrange()` function that doesn't support all the same cases (specifically, it won't support `::x` and `x::`).
  
  > Maybe if there are a couple of entries in the example section, it would reduce the surprise, whatever the name?
  
  Probably a good idea.

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