I am checking out an SVN repository including externals (svn:externals property).
But, apparently, if I use --depth with any value other than 'infinity', the externals are not downloaded. This is especially ironic, since apparently it is possible to update later with --set-depth exclude and exclude folders later.
Is it possible to check out selectively and include all externals?
What are externals definitions? Externals definitions map a local directory to the URL of a versioned resource. The svn:externals property can be set on any versioned directory and its value is a multi-line table of subdirectories and absolute repository URLs.
If you need to see all svn:externals in a directory structure, this is your huckleberry: svn propget -R svn:externals . Logging this here for my own future reference.
svn checkout checks out (retrieves) a working copy of the repository into the specified folder. If you don't have access to the repository, and there's not already a current copy of the source in the folder, you can't possibly do a build. If there is a current copy of the source there, it should include build.
I have the same problem and I don’t have any real answer except the workaround checking out the externals manually afterwards.
mkdir wc
svn co http://example.com/svn/repo/trunk wc --depth=immediates
cd wc
svn co http://example.com/svn/extrepo external --depth=empty
But obviously, this defeats the whole purpose of externals.
This behavior was reported in the Subversion issue tracker as Issue 3311, where it was noted
This was an explicitly defined feature. (There is code to check for this condition and then explicitly skip handling)
(However, the issue was not closed and still has Status: NEW.)
And I was not able to find any explicit reason for this “feature”, I found only the commit which introduced it by swapping checks for the old --non-recursive
option with a check for depth == svn_depth_infinity
, which is a bit too strict, I would say, but it has essentially stayed there ever since.
I'm experiencing the same issue and I don't have a solution, but I think I've at least found a partial workaround.
First I'd like to address David W's question about why this is a problem. I understand where he is coming from in thinking that, if you're picking specific directories you want to checkout, you may assume that you DON'T want ANY other directories checked out ergo, no externals.
HOWEVER, that is not ALWAYS the case. For example, we have multiple development projects that are all related to a third party package. We have a directory that has one external directory that links to the third party product repository and then at the same level as that directory, we have separate directories for different projects we develop related to that 3rd party project. At any given time I may only want to work on ONE of our projects and I don't want to check out the other dozen or so projects, BUT all of our project have relative path references "back" to the 3rd party project directory. So, anytime I checkout one of our projects, I want to make sure that the external link to the 3rd party project also get checked out.
This is the scenario in our shop where, we need sparse checkout but we want any externals that are attached to any of the directories in the sparse checkout chain to be checked out as well.
Now, for the partial workaround....
What I found was, after I use TortoiseSVN to do the initial sparse check out,(which doesn't get my externals) if I then go to the command prompt and execute the following while in the directory above the directory the external property was associated with (Not sure yet if that fact is relevant but figured it was worth mentioning since others say they didn't get similar results using svn up):
svn up --depth infinity
it will check out my externals (note that it did NOT pull down any of the directories that I had not selected when I picked my sparse checkout to begin with). SO this got me where I wanted to be.
This is "BETTER" but definitely is still not perfect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With