[PATCH 4 of 7] patch: drop internalpatch checks for NoHunks

Mads Kiilerich mads at kiilerich.com
Wed Apr 28 07:39:01 CDT 2010


Benoit Boissinot wrote, On 04/28/2010 02:16 PM:
> On Wed, Apr 28, 2010 at 12:51 PM, Mads Kiilerich<mads at kiilerich.com>  wrote:
>    
>> In my opinion we don't have to recognize all malformed patches as long as we
>> handle the well-formed patches correct and don't behave too badly on
>> malformed patches.
>>
>> The "internal patcher failed" message and fallback to external patcher seems
>> very odd.
>>
>> ...
>>
>> Admitted: There is no strong evidence here.
>>
>> Could someone please explain in test or code comments why NoHunks and the
>> state variables are needed and for which cases - and thus prove that this is
>> a bad idea?
>>
>>      
> The idea is that if someone tries to patch something and we don't
> detect any changes, then it *must* be a bug.
>    

Bug? Applying an empty patch is so stupid that it probably is a user 
error, but why should Mercurial have special handling of that? Leaving 
the working directory and dirstate unmodified seems like the obvious and 
well-defined behavior in that case.

By the way, one specific problem: It seems like gitworkdone isn't 
initialized properly for new files?

/Mads


More information about the Mercurial-devel mailing list