Jason Briggs did some investigation of Hg on Jython (https://blog.headius.com/2007/08/business-case-for-supporting-jython.html), apparently this requires implementing at least:
- bz2 - part of UpgradeTo25CPythonLib, we might be able to use https://www.kohsuke.org/bzip2/
- cx_bsdiff - Source code here, https://sourceforge.net/projects/cx-bsdiff/ with more documentation at https://starship.python.net/crew/atuining/cx_bsdiff/