[PATCH 4 of 4 hyperblame] annotate: add a new experimental --skip option to skip revs

Gregory Szorc gregory.szorc at gmail.com
Fri May 26 01:14:46 EDT 2017


On Thu, May 25, 2017 at 8:24 PM, Siddharth Agarwal <sid at less-broken.com>
wrote:

> On 5/25/17 8:19 PM, Gregory Szorc wrote:
>
>> I could also imagine the inverse of a skip feature: an "include" feature.
>> You could use this to say "only annotate revisions that correspond to
>> tagged revisions" so you could easily see how a file evolved from release
>> to release.
>>
>
>
> Huh, interesting. I hadn't thought of that.
>

Following that line of thought, why are we defining this in terms of a
"skip" list? Everything else in Mercurial that speaks in revisions does so
in an inclusive manner. e.g. `hg log` can be thought of as `hg log -r
'all()'`. The feature we're talking about essentially turns `hg annotate`
from "start at <revision> and consider all() revisions that are ancestors"
to "start at <revision> and consider <revset> revisions that are
ancestors," as a skip list is essentially "all() - <skips>." So we /could/
invert the design so we teach `hg annotate` which revisions to "consider"
or are "relevant." `hg annotate -r 123 --from 'all() - desc(backout) -
desc(REFACTOR)'` or something to that effect. The only thing this really
changes is that files defining revsets would have to invert inclusion. e.g.
instead of "X\nY" the file is "all()\n-X\n-Y". That's mildly more annoying,
but arguably more useful and flexible than figuring out semantics when
there is an implicit all() involved.

And I hate to scope bloat, but while we're here, we may want to also
consider how to expose a "reverse blame" (finding a future changeset that
touches a line) feature via the CLI, as some implementations may wish to
combine the concept of an include/skip revset with the direction. e.g. `hg
annotate -r . --from <revset>` and `hg annotate -r . --to <revset>` versus
say `hg annotate -r . --consider <revset> --forward`.

(I haven't fully thought a lot of this through. Just kind of thinking out
loud.)


>
> I think I've been convinced that specifying --skip on the CLI should
> disable reading the defaults file.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170525/6fcbc9d3/attachment.html>


More information about the Mercurial-devel mailing list