branchmap: stringify int in a portable way
We actually need a bytes in Python 3, and thanks to our nasty source
loader this will portably do the right thing.
branchmap: don't use buffer() on Python 3
This is certainly slower than the Python 2 code, but it works, and we
can revisit it later if it's a problem.
py3: use bytearray() instead of array('c', ...) constructions
Portable from 2.6-3.6.
summary: don't explicitly str() something we're about to %s
str() is wrong on Python 3 here, and %s implicitly calls str() anyway,
so this was just extra dancing for no reason.
context: implement both __bytes__ and __str__ for Python 3
They're very similar, for obvious reasons.
context: work around `long` not existing on Python 3
I can't figure out what this branch is even trying to accomplish, and
it was introduced in
ac89a23ca814 which doesn't really shed any
insight into why longs are treated differently from ints.
phases: explicitly evaluate list returned by map
On Python 3 map() returns a generator, which bool()s to true even if
it had an empty input set. Work around this by using list() on the
map() result.
ui: check for --debugger in sys.argv using r-string to avoid bytes on py3
Our source loader was errantly turning this --debugger into a bytes,
which was then causing me to still get a pager when I was using the
debugger on py3. That made life hard.
minirst: use bytes.strip instead of str.strip
bytes.strip exists in Python 2.6 and Python 2.7 also.
smcposix: pass unicode as first argument to array.array
This is an instance where we can safely convert the first argument, rest are
the cases except one where we are using 'c' which is not there in Python 3. So
that needs to be handled differently. This will help in making `hg help` run on
Python 3.