SVN 1.5 hits the street
Subversion 1.5 was released this week. Added in this release: less suck!
Subversion 1.5 was released this week. Added in this release: less suck!
After working with CodeIgniter for a few months (and WordPress for a few years), I’ve settled on a way to set up web projects that works well for development, deployment, and source control. Note that this style of layout only works on systems like Mac and Linux that have useful symlinks.1
First, the folder layout
some-domain.com/
app/
config/
controllers/
(etc)
public/
.htaccess -> ../site-extras/.htaccess
favicon.ico -> ../site-extras/favicon.ico
js/ -> ../site-extras/js
images/ -> ../site-extras/images
system/
application/ -> ../../app/
site-extras/
js/
images/
.htaccess
The layout favours a vhost setup, and splits your code and resources out of the CodeIgniter sources. Splitting your stuff from the CodeIgniter stuff lets you link your Subversion repository to theirs, so that you can keep it in sync with their development.
How it’s done
svn link to CodeIgniter’s repo (via svn propedit svn:externals, with public http://dev.ellislab.com/svn/CodeIgniter/tags/v1.6.2/) and run a svn update to grab the framework. See the Subversion docs for details.application folder to the site root (as app), remove the .svn folders, symlink to application, and add it to your local svn repo.public webserver root, and configure your local machine (and public webserver) to point to this root for the domain’s virtual host setup.$application_path to point to ../public/app/ (I’m not sure which is better yet). See the CodeIgniter docs on apps for more details.You now have a CodeIgnitor project ready for development. You can keep up-to-date with CodeIgniter updates, deploy easily, and get at your code without wading through extra levels of hierarchy.
The Gnome developer site has a HOWTO explaining how to use Git with Subversion repositories. I’m going to give it a try, as local check-in (and branch management) speed is king.
One of my few nits about Subversion is that it’s a pain to track merge points, as dovetailing changes from a release branch to the trunk requires recording (or digging for) the revision of each point you’ve merged. Subversion 1.5 will support merge tracking, which solves the problem for most common uses.
Or, if you think Subversion users are retards, you could always just switch to Git (Linus does have a point, but he’s being a bit of a git about it himself).
A Subversion to changelog script, a handy analog of cvs2cl.
Howto speed up OpenSSH connections with ControlMaster, as suggested by a comment on Slashdot earlier today.
Howto upgrade Wordpress using subversion, a far simpler method if you know how to use svn.
How do I manage several different projects under Subversion?. This confused me at first as cvs doesn’t allow checkouts from the repository root. Also check out the answer to How can I do an in-place ‘import’?
A free, online book: Version Control with Subversion (via marc.abramowitz.info).
A good Subversion + ssh tutorial (targeted to Debian users), and one for Windows/Tortoise SVN users.