You are here

svn propset svn:externals

Error message

Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in drupal_strip_dangerous_protocols() (line 1458 of /home2/crephoto/public_html/techblog/includes/common.inc).

Every so often when I have to set an external reference to a remote repository, it takes me a number of tries to get the syntax right, and I often stumble over the ubiquitous "svn: warning: Error handling externals definition". Here is the proper procedure and syntax.

First change to the directory where you want to create the external reference. For example, I'm using an external module called "ion_auth", and I want to put it into the "ion_auth" subdirectory.

DO NOT create the ion_auth sub-directory prior to issuing the following command:

svn propset svn:externals 'http://foo.net/ion_auth ion_auth' .

Next, commit the repo

svn commit

Then update

svn up

Your external reference should be imported into the 'ion_auth' subdirectory.

Note that if you want to have to external references within the same directory, you should put them in a file and use the "-F" option:

svn propset svn:externals -F ~/svn_externals.txt .

Your svn_externals file should follow this syntax:

local/path/foo http://foo.net/ext1_repo_foo
local/path/bar svn://bar.org/ext2_repo_bar

Remember that if you make revisions to the externals, you have to commit them separately from your main source control.