store: use native fncache encoding function if available
This currently falls back to Python for hashed encoding.
--- 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):