Making quilt and subversion work together

At work, I’ve recently taken up managing the codebase of GridSAM. Part of this involved arranging and moving a whole load of patches from one svn repository (maintained internally) to another (the SourceForge site). Subversion on its own isn’t all that good at this, so I started using quilt to manage the patches. The workflow goes something like this:

Now, this is all well and good, except that in that last step, you have to fiddle with the internals of quilt so that the patch is no longer in the quilt stack. Ideally, I want to shift the bottom patch off the quilt stack after you’ve applied it into the subversion repository. Even better, I’d like to be able to do all of the above work with a single command.

I’ve therefore written a quilt svn command that does just that. Download it, put it in /usr/share/quilt/ (or wherever your quilt install is), and then:

$ quilt svn

will apply the current quilt patch to the subversion repository, commit it using the patch comments from quilt as the commit message, and remove the patch from the quilt patch series. You can do this at any point in the quilt series, but it will probably break things if you try it when you're not at the first patch in the series. (This behaviour should probably be changed).

If you want to apply several patches, you can give either the number of patches to apply:

$ quilt svn 3

or the name of the last patch in the sequence to apply:

$ quilt svn last-patch-of-the-block