Skip to content

Commit cb0565b

Browse files
committed
print an explanation how inlining works
1 parent ba34092 commit cb0565b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,49 @@ def import_python_sources(args):
771771
pypy_sources = args.pypy
772772
import_version = args.msg
773773

774+
print """
775+
So you think you want to update the inlined sources? Here is how it will go:
776+
777+
1. We'll first check the copyrights check overrides file to identify the
778+
files taken from CPython and we'll remember that list. There's a mapping
779+
for files that were renamed, currently this includes:
780+
\t{0!r}\n
781+
782+
2. We'll check out the "python-import" branch. This branch has only files
783+
that were inlined from CPython or PyPy. We'll use the sources given on
784+
the commandline for that. I hope those are in a state where that makes
785+
sense.
786+
787+
3. We'll stop and wait to give you some time to check if the python-import
788+
branch looks as you expect. Then we'll commit the updated files to the
789+
python-import branch and move back to whatever your HEAD is now.
790+
791+
4. We'll merge the python-import branch back into HEAD. Because these share
792+
a common ancestroy, git will try to preserve our patches to files, that
793+
is, copyright headers and any other source patches.
794+
795+
5. !IMPORTANT! If files were inlined from CPython during normal development
796+
that were not first added to the python-import branch, you will get merge
797+
conflicts and git will tell you that the files was added on both
798+
branches. You probably should resolve these using:
799+
800+
git checkout python-import -- path/to/file
801+
802+
Then check the diff and make sure that any patches that we did to those
803+
files are re-applied.
804+
805+
6. After the merge is completed and any direct merge conflicts are resolved,
806+
run this:
807+
808+
mx python-checkcopyrights --fix
809+
810+
This will apply copyrights to files that we're newly added from
811+
python-import.
812+
813+
7. Run the tests and fix any remaining issues.
814+
""".format(mapping)
815+
raw_input("Got it?")
816+
774817
files = []
775818
with open(os.path.join(os.path.dirname(__file__), "copyrights", "overrides")) as f:
776819
files = [line.split(",")[0] for line in f.read().split("\n") if len(line.split(",")) > 1 and line.split(",")[1] == "python.copyright"]

0 commit comments

Comments
 (0)