# HG changeset patch # User Bryan O'Sullivan # Date 1348010720 25200 # Node ID 7840d81a80ec19b03b8c617c2c630941b79fe6b2 # Parent 4038071af82a8c695d9630cf0b15a9528e6300cc store: use native fncache encoding function if available This currently falls back to Python for hashed encoding. diff -r 4038071af82a -r 7840d81a80ec mercurial/store.py --- a/mercurial/store.py Tue Sep 18 16:09:02 2012 -0700 +++ b/mercurial/store.py Tue Sep 18 16:25:20 2012 -0700 @@ -422,8 +422,16 @@ def _plainhybridencode(f): return _hybridencode(f, False) -def _dothybridencode(f): - return _hybridencode(f, True) +_pathencode = getattr(parsers, 'pathencode', None) +if _pathencode: + def _dothybridencode(f): + ef = _pathencode(f) + if ef is None: + return _hashencode(dotencode(f), True) + return ef +else: + def _dothybridencode(f): + return _hybridencode(f, True) class fncachestore(basicstore): def __init__(self, path, openertype, dotencode):