patch.py - bug and patch

Patrick Mézard pmezard at gmail.com
Sun Dec 14 14:56:08 CST 2008


Benoit Boissinot a écrit :
> On Tue, Dec 9, 2008 at 2:00 AM, Bartosz SKOWRON <getxsick at gmail.com> wrote:
>> On Sun, Dec 7, 2008 at 11:02 PM, Bartosz SKOWRON <getxsick at gmail.com> wrote:
>>
>>> so i wrote some tests and patch as well. check attachment :)
>> Ok, I moved re.compile() outside the function and it makes the
>> function much faster, and unit tests are go in 0.000s now.
>> Also, I added some tests which failed, and the regexp is rewritten now
>> to fix it. I'm not sure if it's optimal, any objectives?
> 
> Patrick, did you have a look at this? A potential concern might be that
> the previous code was working for some unusual patch headers whereas
> this one is more constrained (but obviously the previous code wasn't
> working for filenames with embedded spaces).

Actually, I wrote a similar fix a long time ago until I found I was unable to produce any bugs. The thing is Mercurial diff code or GNU diff add the TAB after the filename, so we have to find a diff tool which does not. I am reluctant to push this fix unless we can find a use case where it breaks.

--
Patrick Mézard


More information about the Mercurial-devel mailing list