Patch Maker Quickstart

Patch Maker is a tool which encapsulates and accelerates common software development operations when using CVS or SVN. It helps you:

Believe me, it's worth the effort of reading this page - this software has the potential to save you a ridiculous amount of time if you work with many patches at once. :-)

Terminology

Patch Maker keeps two files relating to each patch - the file list, mentioned above, named <patchref>.files, and the latest results of the pmdiff command, named <patchref>.diff. Both files are kept in the data directory, specified in your .pmrc file.

Installation

You need a copy of CVS or SVN and a working checked-out tree of the software you are working on. Getting these things is beyond the scope of this document.

You need Perl. Move the pm script somewhere on your path. Create a .pmrc file to match your setup. This allows you to define things like your favourite editor, and where you want Patch Maker to keep its files.

Change to the directory where you put the script, and run perl pm --init. This will create symlinks or batch files as appropriate, which let you use the "short form" Patch Maker commands. If you are on Windows and using the cygwin bash shell instead of the DOS prompt, you might like to ignore the batch files and set up aliases in your .bashrc instead.

Commands

See the Command Reference for a list of Patch Maker commands.

pmlist has a handy feature if you are testing or working on other people's patches. Save their patch as patchref.diff in your data directory, and pmswitch to a new patchref. Run pmlist. Patch Maker will understand you've grabbed someone else's patch, and populate the file list with the names of the files referenced in the patch.

Worked Example

Here's an example use which shows off most of the features (using the long names for all command, for clarity.) You start in the root of your CVS sandbox. You use pmswitch <patchreference> to tell Patch Maker you are working on a particular patch. Bug numbers make particularly good patch references; you shouldn't use any characters in a patch reference that aren't allowed in filenames. Once you are working on that patch, you run pmlist to see you have no files. So use pmadd <pathname> to add some.

When some filenames are in the list, pmedit <pattern> will load all the files from the list matching the pattern into your editor. So, pmedit *.js will load all the Javascript files in your working files set. Having edited the files and saved them, to get a diff to submit for review, execute pmdiff. It will produce a diff of only the files in the file list (handy if you are working on several things in the same directory). Use pmview to have a look at it.

If you need to attach the patches to a bug, you'll find them called <patchref>.diff in the Patch Maker data directory that you specified in the script at install time.

Trying It Out

This is a step-by-step hands-on tutorial using Mozilla as an example. It could probably be followed using other bits of software.

Original URL: http://www.gerv.net/software/patch-maker/quickstart.html