7

I have a Subversion repository called 'repo'. Inside of repo are trunk/ and branches/ directories. Within branches/ there are several dozen release branches, e.g. 1.0/, 1.1/. These branches/ directories contain a relatively large application.

I want to add an external at the root of repo, called 'myExternal'. When I define the external, the only way to get SVN to create the myExternal/ directory is to run 'svn up' from the root of repo. However, this will also cause the entire contents of branches/ to be checked out, which is unacceptable (we have many developers that need to get myExternal/ added to their copy of repo, and can't have all of them checking out gigabytes of unneeded branches).

I've tried 'svn up --set-depth immediates', but that doesn't seem to get the externals. Is there any way to tell svn to fetch myExternal/ without fetching all of branches/ ?

Using SVN 1.7.

egherrmann
  • 73
  • 1
  • 5

2 Answers2

6

Externals are just svn checkouts so you can check them out manually.

You could also use a command like this. You may have to modify it a bit if your externals are in a different format.

svn propget svn:externals | awk '{print $2, $1}' | xargs -L1 svn co
Brice M. Dempsey
  • 1,985
  • 20
  • 16
  • 1
    `svn propget svn:externals | xargs -L1 svn co` in my case worked – Fedir RYKHTIK Oct 14 '14 at 15:37
  • svn propget svn:externals | sed -e 's/ / .\//' | sed -e 's/\'//g' | xargs -L1 svn co - worked for me – TCS Aug 03 '15 at 03:15
  • I should have clarified that we already were simply checking out manually. My intention was to see if there was a native way to do this with the initial 'checkout' – egherrmann Nov 28 '15 at 19:14
4

Yes, that is the known issue of subversion externals are not created unless depth=infinity.

I think there is no way as to redesign your directory structure so that myExternal is attached not to the repo but to its subfolders, e.g. set on /trunk and every folder in /branches.

Or you can create a script that at first fetches immediates of repo and then fetches externals set on repo (which it may get by reading properties of repo: svn propget svn:externals).

pmod
  • 10,450
  • 1
  • 37
  • 50