store: add a fallback _pathencode Python function
which does the equivalent of parsers.pathencode, so it can be used as a
default
store: move _plainhybridencode and _dothybridencode higher up in the file
no functional change
test-hybridencode: use store._dothybridencode(s)
and compare it with the result of store._hybridencode(s, True)
store: fix _hashencode call in _dothybridencode
Fixes
7840d81a80ec
check-code: catch yield inside try/finally (with tests)
This is not allowed in Python 2.4.
store: use native fncache encoding function if available
This currently falls back to Python for hashed encoding.
tests: run test-hybridencode.py over both Python and C encoders
This ensures that the two always give the same answers.