When you don't build the Mozilla source tree yourself, finding and getting to the files that need to be edited in Mozilla can be difficult. However, you can use the various Patch Maker commands in Build Mode to extract files from the right JARs, add them to your Patch Maker project, edit them, and create the patches, all in an integrated and easily traceable way. These patches can then be submitted back to mozilla.org so that developers working in the source tree can apply and test them. See the Section B.2.2 section later in this appendix for more information about using Patch Maker in this way.
This process is possible because Mozilla's user interface is written in XUL, JavaScript, and CSS, and interpreted at runtime. Because understanding CVS or compiling code isn't necessary, Patch Maker greatly lowers the barrier to entry for contributing code to Mozilla. Significant patches, such as one used for draggable toolbars, are made using this tool.
Patch Maker runs under Linux and Windows, and is experimental on Mac OS X. The latest version of Patch Maker is at http://www.gerv.net/software/patch-maker/. This application can be used in one of two modes. CVS mode is used by developers who develop and maintain code in a CVS tree and make their changes in the tree. Build mode makes it possible to produce patches that fix some bugs in Mozilla without downloading and compiling the source.
Table B-3. Patch Maker's CVS mode commands
Command |
Description |
---|---|
pmlist |
Shows the file list. |
pmadd <filename> |
Adds filename to the file list. |
pmremove <filename> |
Removes filename from the file list. |
pmdiff |
Does a cvs diff -u of all files in the file list. Extra arguments, such as -w, are passed through to diff. This command won't clobber your old diff if the new one has a size of zero. |
pmview |
Brings up your diff in an editor window. |
pmupdate |
Updates CVS on all files in the file list. Extra arguments to this command are passed through to the CVS update. |
pmpatch |
Patches your diff into your CVS tree. Takes a -R to back the patch out again. |
pmedit <pattern> |
Brings up files matching the pattern in your editor. The pattern is a glob, not a regexp. If there are no arguments supplied, then all files are opened. |
pmwhich |
Prints the current patch reference. |
pmswitch <patchref> |
Changes Patch Maker to work with a new patch reference. It automatically creates a pmupdate( ) and a pmpatch( ) (which won't have any effect if the patch is already applied.) |
pmgrep <pattern> |
Greps for pattern in all of the current patch's files. Good if you can't remember where you put some code. |
pmcopy |
Copies all files in the file list to their positions in your installed Mozilla tree. Takes a -f argument to force copying of all the files. |
pmsetpath |
Points Patch Maker to your current Mozilla-built installation's chrome directory. Use /usr/src/mozilla/dist/bin/chrome/ if you build yourself. |
pmunjar |
Unjars the chrome in your setpath installation. |
pmexecute |
Runs the executable in the setpath installation. Extra arguments to this command, such as &, are passed through to the executable. |
pmcheckin |
Runs pmwhich, pmupdate, pmdiff, and pmview to show what you are about to change, and then asks you if you really want to check in. |
pmcvsadd |
Does a CVS add of all files. Previously added files fail with a harmless message. You need to use this command for new files so the CVS diff will work properly. |
Execute pms test. Patch Maker will tell you that you are working on patch "test."
Execute pml. Note that no files are currently in your patch.
Execute pma content/navigator/navigator.xul to add navigator.xul to your patch.
Execute pml again and see if it was added. Experiment with pma and pmr if you like.
Edit the file again to make it "YourBrowser." Save the file.
Press Ctrl-N in your Mozilla window. The new window should be titled "YourBrowser."