Articles tagged in subversion

  1. Unfuddle Free SVN Hosting

    Unfuddle is a secure, hosted software development environment and project management solution for small software development teams. It's like SourceForge which has good project management tools. It is like Google Code Project Hosting and very Web 2.0'ish, and has a Subversion repository. Unlike others though, is that hosted project does not need to be open source, and you can pretty much do whatever you want. Free account only gives you 15Mb of space which is only suitable for small projects. I think I'll stick to SVN hosting at Dreamhost, and try to get Trac working.

  2. Use svn:externals to install WordPress plugins

    This post is inspired by Alex King's WordPress updates via Subversion.

    Currently I have got 7 installations of WordPress running various sites of mine (excluding around 20 other installations at FOCUSer.net which I also manage). Each site runs more or less a similar set of plugins (some of them developed by myself), but each installation has its distinct theme. Unlike Alex, I do not edit WP's source code so Subversion's merge-on-update has little use to me. However, with Subversion's svn:externals property, it is now trivial to keep your WordPress installations and many plugins and even themes up to date, with a single svn update command.

    Install WordPress via Subversion

    There are some instruction on WordPress' download page on how to install WordPress via Subversion. However, the instruction is targeting developers and source that gets checked out is the trunk, i.e. the branch that has been actively developed upon and will hopefully become 2.1 in the near future. It is not suitable for a production site, which the current stable branch 2.0 is much preferred.

    To check out the 2.0 branch, use the following command instead:

    svn checkout http://svn.automattic.com/wordpress/branches/2.0/
    

    A directory "2.0" will be created containing the complete WordPress 2.0 source code. Move/rename it to whatever you want, and you can pretty much start WP's "5 minute install" from this freshly checked out tree.

    Install Plugins via Subversion

    You can only install plugins that have Subversion repository. Everything hosted on WP Plugin Repository has one. Plugins that I wrote also have Subversion repository hosted at DreamHost (mental note to myself: need to remember to publish those repositories).

    The key is to edit the "svn:externals" property on the wp-content/plugins directory to include those plugins. They will be installed into their own directory, but that's fine -- WordPress can grab plugins from sub-directories.

    For example I wish to install both Permalink Redirect and Mark Jaquith's Subscribe to Comments plugins. First of all, change directory to wp-content/plugins, and issue the following Subversion command:

    svn propedit svn:externals .
    

    It will bring up your favourite text editor (note: it can't actually guess so be sure your EDITOR environment variable has been set) to edit the svn:externals property on that directory. For a stock WP 2.0 installation, you'll see Akismet plugin is already there. Now, add the entries for the two plugins that you wish to install there.

    akismet http://svn.wp-plugins.org/akismet/trunk/
    permalink-redirect http://svn.fucoder.com/fucoder/permalink-redirect/
    subscribe-to-comments http://svn.wp-plugins.org/subscribe-to-comments/trunk/
    

    It is in the format of "<directory name> <repository URI>". Now save the file and quit the browser. Nothing happened -- until you try to update the directory. By issuing the command:

    svn update
    

    Subversion will pull both plugins from two different repositories and put them under your installation. Now go to your WordPress admin page, and you should be able to see the two new plugins there. Neat huh?!

    Upgrade WordPress

    To upgrade your WordPress installation that has been previously checked out to the latest revision in the same branch (for example, 2.0.3 when it gets released), you just need to go into your WP directory and issue this command:

    svn update
    

    It will then automatically pull all the updates from remote repository and apply to your installation, doing 3-way merges with files you have changed if necessary. Resolve any conflicts if you have spot any.

    Since Subversion updates propagate through directories, it will also try to pull any update to the plugins that you have installed. In fact you can run svn update as often as you like to ensure all your svn-installed plugins are on their latest version.

    To upgrade to a new version of WordPress that is on a different branch, you will need to use the svn switch command. For example, WP 2.1 has just been released and you want to be the first to run it...

    svn switch http://svn.automattic.com/wordpress/branches/2.1/
    

    You then have to follow WordPress instructions on updating the database, resolving incompatibility with themes and plugins, etc.

    Conclusion

    Installing WordPress via Subversion has saved me many troubles trying to synchronised various code pieces between sites -- now they all live inside repositories and each installations are merely checkouts of those repositories. For shared code pieces I used for all sites, I just wrap the code inside a mega-plugin, put that into my own SVN repository, and then use svn:externals to include it into each of my sites.

    In fact, I also put all my customised themes into SVN repository and add them back in the wp-content/themes directory using the same method. I think the WordPress theme repository should deploy Subversion as well, so that theme users can get quick updates whenever the theme author has committed the latest change.

    Update: As per Matt's suggestion, there is actually a WordPress themes repository which you can use svn:externals to import themes. Nice.

  3. Subversion Hosting at DreamHost

    Sorry that I have not been blogging here for weeks -- very busy at work which translates very little time coding for my own. I wish I can just write about all the WTF I've enountered at work over the past weeks, trying to make a multi-threaded CORBA-interfaced Python app server scalable (note "multi-thread", "Python" and "scalable" usually don't appear on the same sentence).

    Anyway.

    DreamHost (affiliate link) has recently implemented HTTP-based Subversion on their servers, and you can keep unlimited number of source repositories inside your shared hosting account. You can alter the access control either via their clumsy web interface, or since SSH to their Linux boxes is provided, you can just alter the ACL yourself.

    That's pretty neat for 20Gb of repository storage at $10 per month. I know other hosts like TextDrive have this for ages, but not at a price point that I would like to pay. Putting a search phrase subversion hosting into Google brought back quite a few other service providers, and they are all pretty expensive.

    Therefore I have started importing some of scripts under code section into my new SVN repository, which is currently publicly readable, and will try to point all my downloads over there. It shall hopefully help me getting more code pieces here more organised.

  4. SCM Comparison

    Comparison between different open source and proprietary source control management software. Many alternatives, with Subversion winning the favour of many open source developers. But we all agree that CVS and Visual SourceSafe should not be used for any new projects.