encoding: add converter between native str and byte string
This kind of encoding conversion is unavoidable on Python 3.
encoding: factor out unicode variants of from/tolocal()
Unfortunately, these functions will be commonly used on Python 3.
py3: use next() to obtain next item from inner generator of generatorset
.next attribute does not exist on Python 3. As this function seems to really
care about the overhead of the Python interpreter, I follow the way of micro
optimization.
py3: rewrite itervalues() as values() by importer
I'm not a great fan of these importer magics, but this should be okay since
"itervalues" seems as unique name as "iteritems".
exewrapper: prefer HackableMercurial python if availbale
Currently hg.exe will only try to load python27.dll from hg-python
subdir if PYTHONHOME environment variable is not set. I think that
it is better to check whether 'hg-python' subdir exists and load
python from it in that case, regardless of environment. This allows
for reliable approach of distributing Mercurial with its own Python.
import-checkers: split tests of the tool from running it on the source
We did such splits for other tools already. The 'test-check-*.t' performs the
check of the source code while the regular tests verifies the tools works.
One of the benefit is that is provides a simple file to reuse in third party
extensions.
py3: use bytestr wrapper in revsetlang.tokenize()
This backs out
77270ec0cdd9 and wraps program by bytestr() instead.