Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get SVN to ignore a directory inside an externals definition

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?

like image 879
NerdStarGamer Avatar asked Jan 21 '10 20:01

NerdStarGamer


2 Answers

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.

like image 135
Michael Hackner Avatar answered Oct 03 '22 10:10

Michael Hackner


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.

like image 20
jpierson Avatar answered Oct 03 '22 08:10

jpierson