I’ve found a solution. It uses externals definitions, the same way plug-ins are handled if you install WordPress via Subversion. This allows any number of sub-directories in your local repository to be associated with different remote repositories.
First, import your custom folder (whether it be a theme directory or whatever) into your own remote repository. Remove this directory from your local WordPress directory structure.
Now you need to declare that this same directory (now deleted but soon to be checked out) is to be managed externally. Change into into its parent directory and run:
svn propedit svn:externals .
An editor window should open (this assumes that you’ve set some kind of EDITOR environment variable in your shell).
Externals definitions are defined as follows:
<sub directory name> <URI of external repository>
Save and close.
Now try running svn up
. The custom sub-directory and its original contents should be recreated.
It took a lot of fiddling around for me to get it working smoothly, just make sure you backup any important custom files first before trying. One thing I’ve noticed is that you need to be inside your sub-directory when committing changes for it. If you try svn ci
in any directory above it then it will complain that you don’t have permission to make those changes to the remote WordPress repository (well it did for me but I’ve checked out a stable tagged version).