<div dir="ltr"><div>I successfully made `hg --version` work on Python 3.5b2 without relying on the 2to3 rewriting tool!<br><br>$ hg pull -r  598011934aa4 <a href="https://hg.mozilla.org/users/gszorc_mozilla.com/hg">https://hg.mozilla.org/users/gszorc_mozilla.com/hg</a><br></div>$ hg up 598011934aa4<br><div>$ HGRCPATH=/dev/null HGDEMANDIMPORT=disable ~/.pyenv/versions/3.5.0b2/bin/python hg --version<br>b'Mercurial Distributed SCM (version unknown)\n'b'(see <a href="http://mercurial.selenic.com">http://mercurial.selenic.com</a> for more information)\n\nCopyright (C) 2005-2015 Matt Mackall and others\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n'<br><br></div><div>The output formatting obviously isn't correct. But it demonstrates that modules can be imported and basic dispatch works. You need to start somewhere.<br><br></div><div>In my zeal to produce this 176 commit series, I took a number of shortcuts. My goal was to get Python 3 working at no costs. This meant creating some hacky patches that drop 2.x compatibility. This compatibility can be restored with a few more hours of work.<br><br></div><div>The "use modern exception syntax" and "use modern octal literals syntax" subset of commits can likely land today. The absolute imports commits could also start landing. Although, I believe we need a bikeshed over how we want to formulate imports going forward (grouping, alphabetize, etc). The rest of the commits are generally hacky (I tried to put "HACK" in the commit summary line to indicate the commit isn't suitable for consideration).<br><br></div><div>The series really isn't in a terrific state to facilitate cherry picking. But it could be. Please let me know what you are interested in taking and I'll rewrite things accordingly. (I think mass rewriting to modern exception and octal literal syntax and enforcing these via check-style would be good first steps.)<br><br></div><div>Gregory<br></div></div>