views:

208

answers:

4

I'm using subversion to host my own repository for a WordPress installation. I've got it set up so that all of the core WordPress files are in their own directory (called wordpress) and set up to use svn:externals to link to the WordPress repository. I then have my own copy of the wp-content directory (located outside of the wordpress directory) which does not use svn:externals. This is all working fine.

When I update my repository, the WordPress core gets updated. Since the WordPress repository contains it's own wp-content directory, it also updates that directory. So my file structure ends up looking something like this:

/
--/wordpress/   (wordpress repo)
-----/wp-admin/
-----/wp-content/
--/wp-content/  (my local repo)

I end up having two separate versions of the wp-content folder (one from my repo and one from the WordPress repo). I don't want the one from the WordPress repo (or at least not in that location). Is there a way for me to set svn to ignore the wordpress/wp-content directory while still using externals definition?

A: 

You can do this with sparse directories (also known as shallow checkouts). I am not 100% sure it works when using externals, but I don't see why it wouldn't.

RedFilter
I don't think that sparse directories is what I want. I want to be able to set my svn repo to always ignore this particular file (within the external definition) and then forget about it. I don't want to have to type in extra stuff every time I make changes.
NerdStarGamer
A: 

What you’re really asking is, “Can you specify --depth for svn:externals” and the answer is no. Externals currently are fully recursive on the specified directory.

Issue 3216 requests this functionality, but it doesn’t look like it’s coming any time soon.

Michael Hackner
Hmm, ok. I figured you couldn't do what I wanted but I was hoping I had missed something. Thanks.
NerdStarGamer
A: 

You could make separate externals to each subfolder within the referenced repository. So if your external is to a repo with projects A, B, and C and you only want A and B then you can make two separate external reference to the subfolders for A and B individually.

Currently I'm doing this with a project but you can run into problems if you are actually making edits to the externals and committing them since changes in two separate externals cannot be committed atomicly. This problem exists even if the two externals actually point to the same repository which makes sense but is important to note when using this technique.

Also if you are responsible for the second repository, one option is also to tuck testing, documentation and other related folders into a yet another separate repository with externals to the source code in order to separate them from the main code repository. This way these folders won't be pulled in when making an external reference because of code dependencies.

jpierson
A: 

What happens if you try to remove the local wp-content directory, but do it through SVN? ie.

svn rm /wordpress/wp-content

This way SVN should remember your changes, and I assume you aren't pushing stuff to the Wordpress repo, so you don't need to worry about accidentally commiting it.

Matthew Scharley