[PATCH 3 of 3 V2] revset: add a changes(file, fromline, toline[, rev]) revset

Yuya Nishihara yuya at tcha.org
Tue Dec 27 07:37:54 EST 2016


On Tue, 27 Dec 2016 15:10:20 +0900, FUJIWARA Katsunori wrote:
> At Mon, 26 Dec 2016 22:47:14 +0900,
> Yuya Nishihara wrote:
> > 
> > On Sun, 25 Dec 2016 18:06:58 -0500, Augie Fackler wrote:
> > > > On Dec 25, 2016, at 4:44 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> > > > On Sat, 24 Dec 2016 14:56:51 -0500, Augie Fackler wrote:
> > > >> On Fri, Dec 16, 2016 at 02:30:15PM +0100, Denis Laxalde wrote:
> > > >>> # HG changeset patch
> > > >>> # User Denis Laxalde <denis.laxalde at logilab.fr>
> > > >>> # Date 1480086890 -3600
> > > >>> #      Fri Nov 25 16:14:50 2016 +0100
> > > >>> # Node ID 5e5ec2ade2cfc829cffba145193da5801c5b20e7
> > > >>> # Parent  c8dfd10c5865cfe882a00595743f3f709f41317f
> > > >>> # EXP-Topic linerange-log/revset
> > > >>> revset: add a changes(file, fromline, toline[, rev]) revset
> > > >> 
> > > >> I'm +1 on the series as a whole. I'll do one more pass over the diff
> > > >> stuff to try and understand it, but realistically I'm too far removed
> > > >> from that code right now to give it a proper review.
> > > > 
> > > > Looks generally good to me per comparing with the V1 patches.

[snip]

> > > > - what if we want to support multiple fromline:toline pairs?
> > >
> > > Hm. Could that just be done as `changes(file, 10, 20, tip) or changes(file, 40, 50, tip)`? That seems like a good spot.
> >
> > I have some ideas, but none of them look nice.
> > 
> >   changes(file, 10, 20, tip, 30, 40)      # changes(file, from, to[, rev, from, to, ...])
> >   changes(file, '10:20,30:40', tip)       # changes(file, from_to_str[, rev])
> >   changes(file, 10, 20, 30, 40, rev=tip)  # changes(file, from, to, ...[, rev=rev])
> >   changes(file, 10:20, 30:40, rev=tip)    # changes(file, from:to, ...[, rev=rev])
> >   changes(file, tip, 10, 20, 30, 40)      # changes(file, rev, from, to, ...)
> >   changes(file, tip, 10:20, 30:40)        # changes(file, rev, from:to, ...)
> 
> I like from:to style (#4 or #6 above), because of similarity to Python
> indexing style, but current revset parsing seems to treat this format
> as "range expression" forcibly :-<
> 
> But quoting like #2 causes inconvenience.
> 
> Therefore, #3 or #5 above seems reasonable in this list, for me.

from:to is doable since the range expression isn't evaluated yet, though we'll
need to change the way of rewriting rangepre/post. If we prefer it, I can
write a patch as a follow-up.


More information about the Mercurial-devel mailing list