py3: port things from chgserver.py

Authored by pulkit.

Description

py3: port things from chgserver.py

I have installed mercurial on my personal laptop using Python 3.7. I also have
hg aliased to chg. Before this commit, hg version didn't work. After this
patch, things are better and now chg works.

Differential Revision: https://phab.mercurial-scm.org/D6040

Details

Committed
pulkitFri, Mar 1, 6:42 PM
Differential Revision
D6040: py3: port things from chgserver.py
Parents
rHGfaa04f45b5fe: py3: make sure return value of posix.groupname() is bytes
Branches
Unknown
Tags
Unknown