Playground Patches

Today I was thinking, “Wouldn’t it be nice, and save me quite a bit of time, if when you look at a patch on Bugzilla, there was a Test link next to the Edit and Diff links?  And when you clicked it, it would apply the patch to trunk, and if it worked it would configure and make it and then drop you to a shell so you could see what had happened.”  So I made it.

What you will need:

  • Firefox.  Anyone wanting to port this to Ephy is welcome to do so.
  • A suitable build environment for whatever module it is.
  • A svn account.  You can’t do this anonymously, but only because I didn’t write it to do so.  (See below.)
  • gnome-terminal
  • wget (I would worry if you didn’t have this)
  • svn.  I wanted to make this use bzr-playground (hence the name) but I decided to make it use svn to begin with.
  • The actual Firefox extension itself.  You can get it here, but save a copy to your local disk and then open it up in Firefox.  You will have to restart when you install it.  This will also give you the opportunity to go into the XPI and have a look around. Did you realise that XPIs are just zipfiles and you can go in there, change them, rezip them, and reinstall them, and it’ll just carry on working?  You should.
  • A bug with un-applied patches on it.  Here’s one that I am going to get to on Sunday night or Monday, so try “Edited Patch” from there.

Things it should do in the future:

  • Have preferences, and let you specify that you don’t have a svn account.  Also, whether you want to use svn or bzr-playground. (Actually, you can do this for yourself already, by unzipping the XPI, modifying the commands, re-zipping, and reinstalling.)
  • Be clever enough to note who uploaded which patch, and store the information in a hidden file in that directory.  Then there would be a commit script which figured out what to put in the ChangeLog, commit message, and (for bzr) –author switch accordingly.
  • Not be a toy that Marnanel threw together in a few hours.

Warning:  If you run “Test” on the same patch twice, remember to delete in between;Playground Patches doesn’t do this for you in case it overwrites your work.  If you don’t, the patch will be applied twice, which won’t work.

Credit: This started out as a Greasemonkey script (for the sake of easy editing) until it was advanced enough to need XPCOM, and was then originally compiled to an XPI using the arantius.com Greasemonkey compiler.

Published by

Thomas Thurman

Mostly themes, triaging, and patch review.

Leave a Reply

Your email address will not be published. Required fields are marked *