HOWTO include krumo in devel module with svn externals

Svn has a very useful concept, called externals.

The idea, in a nutshell, is that you include code from another subversion server (and repository) into your own subversioned project. Instead of simply copying the code into your project, you link to existing code. That way you simply update remote projects, when working from thirdparty development releases (that library the other team is developing on the sidetrack), and/or switch to new or stable versions when they are released. It is a good way to keep track of third party code such as the excellent krumo library for debugging your Drupal code.

You should have:

  • A versioned Drupal in a working copy
  • Devel module installed and working, also versioned in that working copy.

Move into the development directory.

cd sites/dev.example.com/modules/devel

Note: I do not install devel module in sites/all/modules, for the simple reason that I believe a devel module should be available on your development environment only. (I can hear you think now: but what if I forget a debugstatment somewhere, that would give a fatal error on Live? Answer: don’t. Leave debug statements. And test!)

Find out what the latest stable Krumo is from sourceforge. At hte time of writing that was 0.2.1a. This way we can include a stable version.

svn propset svn:externals "krumo https://krumo.svn.sourceforge.net/svnroot/krumo/tags/0.2.1a/" .

Replace the 0.2.1a with the current stable tag.

Then update the current directory

svn up

Krumo will be inserted into your environment, without the code being imported into your svn repository.

svn ci -m"Added svn:external krumo version 0.2.1a into devel module. Happy debugging\!"

This will push the property to the repository. All people working from that repository will get a copy of krumo directly from sourceforge, on checkout.

Update: Fixed typo. It should be ci for commit and co for checkout.

About the author: Bèr Kessels is an experienced webdeveloper with a great passion for technology and Open Source. A golden combination to implement that technology in a good and efficient way. Follow @berkes on Mastodon. Or read more about Bèr.