import: abort instead of crashing when copy source does not exist (
issue5375)
Previously, when a patch contained a move or copy from a source that did not
exist, `hg import` would crash. This patch changes import to raise a PatchError
with an explanantion of what is wrong with the patch to avoid the stack trace
and bad user experience.
py3: make encodefun in store.py compatible with py3k
This ensures that the filename encoding functions always map bytestrings
to bytestrings regardless of python version.