Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fetch a Subversion external without fetching all other directories and subdirectories

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.

like image 915
egherrmann Avatar asked Apr 04 '12 21:04

egherrmann


People also ask

How do svn externals work?

When you commit a change to the svn:externals property, Subversion will synchronize the checked-out items against the changed externals definition when you next run svn update . The same thing will happen when others update their working copies and receive your changes to the externals definition.

How to add svn external?

Simply right drag the file or folder from one working copy to where you want those to be included as externals. A context menu appears when you release the mouse button: SVN Add as externals here if you click on that context menu entry, the svn:externals property is automatically added.

What is Git svn command?

git svn is a simple conduit for changesets between Subversion and Git. It provides a bidirectional flow of changes between a Subversion and a Git repository. git svn can track a standard Subversion repository, following the common "trunk/branches/tags" layout, with the --stdlayout option.


2 Answers

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
like image 79
Brice M. Dempsey Avatar answered Nov 03 '22 00:11

Brice M. Dempsey


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).

like image 35
pmod Avatar answered Nov 02 '22 23:11

pmod