[PATCH 5 of 5] keyword: check for '\0' in entire data before acting

Matt Mackall mpm at selenic.com
Mon Apr 7 15:40:35 CDT 2008


On Mon, 2008-04-07 at 21:25 +0200, Christian Ebert wrote:
> * Matt Mackall on Monday, April 07, 2008 at 13:26:54 -0500
> > On Mon, 2008-04-07 at 19:10 +0200, Christian Ebert wrote:
> >> # HG changeset patch
> >> # User Christian Ebert <blacktrash at gmx.net>
> >> # Date 1207586716 -7200
> >> # Node ID f4e983f6f4bb5cdbfc0a5ea336133e1588f1dc36
> >> # Parent  84f1bb1bcfc873a31ae97b73b9a2a4711234f92b
> >> keyword: check for '\0' in entire data before acting
> >> 
> >> util.binary might not be safe enough, as it fails eg. on certain
> >> pdf files (issue1066).
> > 
> > *boggle*
> > 
> > How about we just fix util.binary instead of redefining it everywhere
> > it's used one by one?
> 
> Fine. I just don't know enough about the speed impact. And for
> diff, patch, merge :4096 worked for me ... so far.

The speed impact of checking a whole file that we've already pulled into
memory will be quite small in percentage terms.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list