[PATCH RFC] store: _hashencode2 escapes names more simply

Bryan O'Sullivan bos at serpentine.com
Tue Sep 25 18:22:01 CDT 2012


On Tue, Sep 25, 2012 at 2:59 PM, Adrian Buehlmann <adrian at cadifra.com>wrote:

>
> With my parsers.cutdirs this would roughly be:
>
> def _hashencode2(path):
>     prefix, suffix = path[:-2], path[-2:]
>     digest = _sha(prefix).hexdigest()
>     return 'dh/' + parsers.cutdirs(path)[5:] + digest + suffix
>

Yep, likewise with my C version.


> As per the _hashencode2 of Bryan: The encodedir won't help, as the .hg
> ending added by encodedir may have been cut off due to the directory
> truncation (as discussed before).
>

True, but the encodedir is there solely to have the Python code use the
full basic encoding mechanism.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120925/d461c937/attachment.html>


More information about the Mercurial-devel mailing list