14. How to do Sage development, part 2 -- making a patch
- Questions
- Homework: pass out and go over
(< 10 min) Project "status reports"
- Demo -- how to modify the Sage library and create a patch
- Turn on screen capture using Quicktime (plus I'll do this all in one terminal and paste the session log below, though editing won't get recorded).
Login to the [email protected] account. NOTE: On Windows, install Putty. On Linux and OS X use the command line (e.g., Terminal) and type "ssh [email protected]".
- Change to directory with my sage install in it and type "here" to setup PATH.
- Make a change to the Sage library source code using pico, based on a suggestion from class.
- Save the change and test it using "sage -br"
- Type "hg diff" to see the change (your shell current working directory must be a subdirectory of SAGE_ROOT/devel/sage/)
- Type "hg commit" to save changes as a commit. Type "hg revert --all" to instead undo everything you have done. Enter a log message on the first line and save the file, when you do "hg commit".
- Type "hg log|more" to see that you have done something.
Type "hg export tip > file.patch" to create a patch file. You can get the patch by navigating to the directory in which you typed this command, starting here: http://sage.math.washington.edu/home/math480/scratch/
- Congrats, we have our patch. If we don't like it and want to start over, do "hg rollback". This will reset things to be exactly like they were before we typed "hg commit" above.
Remark: For much finer control over making patches, people usually use "Mercurial Queues", as described here in The Sage developers guide. You do not have to use them for your homework.