If you have code which fixes a bug or deals with some issue in Sage, here's what to do: first, use Mercurial to create a patch file. If the issue has been reported as a ticket on the trac server, attach your patch file to that ticket: go to the ticket, click on the ``Attach File'' button, and follow the directions. On the ticket page, you should add a comment explaining your patch, and you should also change the summary for the ticket from description of bug to [with patch, needs review] description of bug.
If there is no trac ticket associated to this issue, create one (as explained in the previous sections) describing the issue and your solution, attach your patch, and give it a summary of the form [with patch, needs review] description of bug goes here.
See About this document... for information on suggesting changes.