Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2010-08-11 19:45:32
Size: 585
Editor: RenatoCunha
Comment: Initial import
Revision 4 as of 2010-08-12 14:09:14
Size: 1698
Editor: RenatoCunha
Comment: Updated the objectives and constraints
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
== Design and constraints == == Objective and constraints ==

This project's objective is quite clear: to "port" mercurial to py3k.
"Port" is between quotes because this is not a complete portm or a rewrite: we
want to make mercurial run in py3k ''while maintaining compatibility with
python 2.x''. There is an additional constraint, though: mercurial supports
python from 2.4, which means the features introduced in 2.6 to ease the porting
process can't really be used in the port. Also, refactoring the code to work in
both python 2 and 3 proved to be too much work because:

 1- It would be troublesome to make a multipython code;
 2- It would be a maintenance hell.

Thus, we came to the conclusion that extending 2to3, the python refactoring
tool, was the way to go. So, to summarize the port's objective and constraints:

 * We want to make hg run on py3k;
 * 2to3 is being used for that;
 * We must maintain support for python 2.4 and above;
Line 19: Line 37:
=== How to enable the port === === How to run it ===

From mercurial's source root, you can run

{{{
python3 contrib/setup3k.py build_ext -i build_py -c -d . build_mo
}}}

to convert the source code to the py3k port. Obviously, this step requires
python 3.

Status of the "port" of Mercurial to Py3k

This document describes the current status of mercurial's Py3k port. The work here described was developed as part of the Google Summer of Code program.

1. Summary

Last milestone: "hg manifest" runs successfully.

Current development: Documentation & Improvement of the fixers to generalize the manual edits

2. Objective and constraints

This project's objective is quite clear: to "port" mercurial to py3k. "Port" is between quotes because this is not a complete portm or a rewrite: we want to make mercurial run in py3k while maintaining compatibility with python 2.x. There is an additional constraint, though: mercurial supports python from 2.4, which means the features introduced in 2.6 to ease the porting process can't really be used in the port. Also, refactoring the code to work in both python 2 and 3 proved to be too much work because:

  • 1- It would be troublesome to make a multipython code; 2- It would be a maintenance hell.

Thus, we came to the conclusion that extending 2to3, the python refactoring tool, was the way to go. So, to summarize the port's objective and constraints:

  • We want to make hg run on py3k;
  • 2to3 is being used for that;
  • We must maintain support for python 2.4 and above;

3. Current implementation

3.1. Source code

3.2. How to run it

From mercurial's source root, you can run

python3 contrib/setup3k.py build_ext -i build_py -c -d . build_mo

to convert the source code to the py3k port. Obviously, this step requires python 3.

Py3kPort (last edited 2012-10-25 20:48:22 by mpm)