Svgwg.org:testing-hooks

From SVG

If you make changes to the SVG WG repository hooks in the repository svg-repo-hooks it is essential that you test your changes before you push them to the server, since even a small mistake can block new pushes (until jwatt fixes things).

To test the hooks locally, you'll need a directory containing a clone of the svg2 and svg2-tools repositories, and the copy of the svg-repo-hooks repository that you made your changes in. The svg2 and svg2-tools repositories must have these exact names, and should not have any local changes.

One you have this setup, you'll need to set the environment variable SVG_HOOKS_DIR to the path of the local copy of svg-repo-hooks that you've made your hook changes in (the file 'hgrc' in svg-repo-hooks depends on this, or else you'll get "abort: No such file or directory" errors due to not being able to find hooks.py).

Edit the .hg/hgrc of the svg2 repository you'll be using for testing to add the line:

%include $SVG_HOOKS_DIR/hgrc

Now when changesets are pushed/pulled to this svg2, the hooks in your modified copy of svg-repo-hooks will be invoked.

The simplest way to trigger the hooks is simply to strip the existing changesets from svg2 and then pull them back in:

cd hook-testing
hg strip 0        # strip the existing changesets
hg pull -u        # pull them back in

As long as you see the messages that the hooks normally print out and there are no errors, you should be good to go.