[PATCH 4 of 4] log: add -L/--line-range option to follow file history by line range

Denis Laxalde denis at laxalde.org
Fri Oct 6 15:01:04 EDT 2017


Yuya Nishihara a écrit :
> On Fri, 6 Oct 2017 16:38:23 +0200, Denis Laxalde wrote:
>> Yuya Nishihara a écrit :
>>> I don't think it's intuitive that '-L PAT1' and 'PAT2' are AND-ed. (Well, I
>>> didn't carefully read the code, but probably PAT2 would be filtered by revs
>>> even though PATs are OR-ed.)
>>>
>>> So I think -L PAT and plain PATs should be mutually exclusive. Alternatively,
>>> -L could be considered pseudo-pair of file pattern.
>>>
>>>     $ hg log FILE1 -L RANGE1 FILE2 -L RANGE2
>>>
>>> I prefer this over -L FILE,RANGE syntax.
>>
>> I'm fine for making -L PAT and plain PATs mutually exclusive, it makes
>> sense.
>>
>> I'm not sure I understand your proposal (how more specifically, how to
>> implement it). How should I make FILE1 and RANGE1 matching? Is there a
>> way to enforce a "-L RANGE" to be followed by a "FILE"? Or should I just
>> assuming that "opts['line_range']" and "pats" will have the same order
>> and length and zip on the two lists?
> 
> There's no way to strictly parse options along with positional arguments, so
> that would be similar to what "prune --biject" does.
> 
> I think we all have UI concern about the last patch. This should get more
> attention.
> 

Ok. I'll submit a v2 addressing other points of your review while
sticking with -L FILE,RANGE syntax (but making it exclusive with plain
file patterns) so that we can focus on this UI question.


More information about the Mercurial-devel mailing list