[PATCH stable] grep: don't search past the end of the searched string

Idan Kamara idankk86 at gmail.com
Tue Nov 13 12:00:03 CST 2012


On Tue, Nov 13, 2012 at 7:55 PM, Nikolaj Sjujskij <sterkrig at myopera.com> wrote:
> Den 2012-11-13 21:12:21 skrev Idan Kamara <idankk86 at gmail.com>:
>
>
>> On Tue, Nov 13, 2012 at 7:10 PM, Idan Kamara <idankk86 at gmail.com> wrote:
>>>
>>> # HG changeset patch
>>> # User Idan Kamara <idankk86 at gmail.com>
>>> # Date 1352826521 -7200
>>> # Branch stable
>>> # Node ID 42cd03020d6d6cbbab5270d8d8bc96aa9324a5e1
>>> # Parent  ce2c709a8e908747376a3fda6059c1f81de321e7
>>> grep: don't search past the end of the searched string
>>
>>
>> This was already applied on crew-default, but since it should go on
>> stable I sent it again with the fixed loop condition below.
>
>
>>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>>> --- a/mercurial/commands.py
>>> +++ b/mercurial/commands.py
>>> @@ -2935,7 +2935,7 @@
>>>      def matchlines(body):
>>>          begin = 0
>>>          linenum = 0
>>> -        while True:
>>> +        while begin < len(body):
>
>  Won't this confuse merging stable into default, resulting in conflict
> (which Matt will have to resolve)? Maybe it's better to graft that changeset
> onto `stable` and fix loop condition with another `stable` changeset?

That's possible, not sure it really matters.


More information about the Mercurial-devel mailing list