On Tue, Sep 25, 2012 at 2:59 PM, Adrian Buehlmann <span dir="ltr"><<a href="mailto:adrian@cadifra.com" target="_blank">adrian@cadifra.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div><br>
</div></div>With my parsers.cutdirs this would roughly be:<br>
<br>
def _hashencode2(path):<br>
<div>    prefix, suffix = path[:-2], path[-2:]<br>
</div>    digest = _sha(prefix).hexdigest()<br>
    return 'dh/' + parsers.cutdirs(path)[5:] + digest + suffix<br></blockquote><div><br></div><div>Yep, likewise with my C version.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

As per the _hashencode2 of Bryan: The encodedir won't help, as the .hg<br>
ending added by encodedir may have been cut off due to the directory<br>
truncation (as discussed before).<br>
</blockquote></div><br><div>True, but the encodedir is there solely to have the Python code use the full basic encoding mechanism.</div>