[PATCH 8 of 8] store: switch to C-based hashed path encoding

Bryan O'Sullivan bos at serpentine.com
Wed Nov 14 12:11:14 CST 2012


On Wed, Nov 14, 2012 at 12:25 AM, Adrian Buehlmann <adrian at cadifra.com>wrote:

> Given how much time I've spent trying to inhibit such bugs in your
> earlier patches, would it be possible for you to explain in detail what
> those two bugs were? In which function were they?
>

One of them related to directory truncation.

If a directory component is "too long", we trim it to a shorter length.
This means that the trimmed name can now end with a period or space, which
are illegal on some filesystem or other (I don't remember which one).

I was already handling the case where we hit a slash character, but I need
to do the same fixup if we hit the upper limit on path length where we stop
copying.

The second bug was a single-bit error in one of the encoding tables. This
caused the C code to encode one byte differently than the Python code.

I think it would be quite easy to add regressions for both of these cases.
That's a good suggestion, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121114/f95fa28b/attachment.html>


More information about the Mercurial-devel mailing list