On Tue, 18 Oct 2016 08:59:58 +0200, Denis Laxalde wrote:
> Jun Wu a écrit :
> > Excerpts from Denis Laxalde's message of 2016-10-03 16:38:17 +0200:
> >>  From UI point of view, the basic idea is to specify a (file name, line
> >> range) pair and the simplest solution I could find is something like:
> >>
> >>    hg log/annotate --line-range fromline,toline FILE
> >>
> >> but this does not work well with several files. (Perhaps something like
> >> hg log FILE:fromline:toline would be better.) I also thought about a
> >
> > +1 for "FILE:fromline:toline". It is intuitive and makes sense. A new
> > boolean flag (like "--line-ranges") that enables the syntax explicitly
> > may be necessary. The flag can avoid conflicts with existing matcher syntax,
> > and make it clear that some commands like "add" do not support line ranges.
> "FILE:fromline:toline" is also my favorite option. But I'm not sure I'd
> like to be forced to specify an extra option to be able to use this
> syntax. I'd much prefer if this could be avoided, though we'll indeed
> have to handle conflicts with existing matcher syntax. Or use another
> separator? Any other idea welcome!

How about extending the fileset syntax?

  $ hg log/annotate 'set:FILE:linerange(FROMLINE-TOLINE)'
                             # ':' attr-name '(' args ')'

We could have a shorthand operator ('%' just for example):

  $ hg log/annotate set:FILE%FROMLINE-TOLINE

This might look crazy, and I think it's actually crazy, but it could be
extended for log --follow (issue4959):

  $ hg log --follow 'set:FILE:rev(REV)'
Mercurial-devel mailing list

Reply via email to