[top] [TitleIndex] [WordIndex]

11/480a/4-27

14. How to do Sage development, part 2 -- making a patch

  1. Questions
  2. Homework: pass out and go over
  3. (< 10 min) Project "status reports"

  4. Demo -- how to modify the Sage library and create a patch
    1. 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).
    2. Login to the math480@sage.math.washington.edu account. NOTE: On Windows, install Putty. On Linux and OS X use the command line (e.g., Terminal) and type "ssh math480@sage.math.washington.edu".

    3. Change to directory with my sage install in it and type "here" to setup PATH.
    4. Make a change to the Sage library source code using pico, based on a suggestion from class.
    5. Save the change and test it using "sage -br"
    6. Type "hg diff" to see the change (your shell current working directory must be a subdirectory of SAGE_ROOT/devel/sage/)
    7. 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".
    8. Type "hg log|more" to see that you have done something.
    9. 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/

    10. 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.
    11. 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.


2013-05-11 18:32