Peg revisions in SVN

April 26th, 2010

One feature missing from early (and even relatively recent; less than v1.5) versions of Subversion is the ability to specify universally the exact revision of a file/directory within a repository across all commands/features (such as “svn switch” and externals). The difference between:

  • “file X/Y/Z which existed at revision 99”, and
  • “the file which exists if you backtrack from HEAD to revision 99 on path X/Y/Z”

is subtle but continues to catch many people out, especially those of us who use older (< 1.5) versions of SVN for one reason or another, typically because RHEL/CentOS 5 include SVN 1.4. I won’t attempt to rewrite the excellent chapter about peg and operative revisions in the online Version Control with Subversion book, but it’s worth remarking on nonetheless. It’s caused myself and my colleagues no end of headaches when trying to do predictable deployments using a specified SVN URL. Essentially, it means these two things are not necessarily equivalent:

svn sw svn+ssh://user@myrepo/X/Y/Z@99 myworkingcopy

and

svn sw -r 99 svn+ssh://user@myrepo/X/Y/Z myworkingcopy

If, between revision 99 and HEAD, you’ve renamed some directories within the path X/Y/Z, then backtracking the history of the current X/Y/Z (as of HEAD; this is the operative revision) doesn’t necessarily lead you back to X/Y/Z as it was at revision 99 (the peg revision). This is quite common when rearranging SVN repositories.

mod_fcgid 2.3 with PHP

April 6th, 2010

Today, and after some experience elsewhere, I upgraded my personal live server (running sites such as Webcams in Norway) to mod_fcgid 2.3. I’ve been using mod_fcgid in production for the best part of a couple of years now, after rather a lot of research and testing into the best solution to securely host multiple PHP sites (and after dalliances with other solutions such as suphp). mod_fcgid is a great solution in many ways but has suffered for a long time from a lack of love – it was always rather fragile and the configuration didn’t always work as documented especially across multiple virtual hosts (and that’s setting aside the confusing option names). But now it’s been taken under the wing of the Apache project, it’s really feeling like a solid and reliable piece of software. Kudos to Ryan Pan, the original author, and all those who have worked on it since.