ui: convert to/from Unicode on Python 3 in ui.editor()
I considered making this I/O be done in terms of bytes, but that would
cause an observable regression for Windows users, as non-binary-mode
open does EOL conversion there. There are probably new encoding
dragons lurking here, so we may want to switch to using binary mode
and doing EOL conversion ourselves.
manifest: use node.hex instead of .encode('hex')
The latter doesn't work on Python 3.
pure: use int instead of long
Similar to the recent
73aa13bc8dac (revlog: use int instead of long,
2017-03-19).
histedit: inline cleanupnode
Move "cleanupnode" (unsafe strip) into "safecleanupnode" so it's impossible
to call the unsafe function directly.
This helps reduce future programming errors.