• Technosailor.com
  • Desk of the Editor
  • Venture Files
  • Tech Policy
  • Contenido Español
Technosailor
  • Authors
  • Disclosures
May
08
2007

Customized WordPress: Understanding Subversion

Posted by: Aaron Brazell

This week, I am tackling a topic of development. Subversion. Namely, Subversion and WordPress and how to create your own custom version of WordPress. However, before I go any further, let me put the disclaimer out there that:

  • You are allowed to do this under GPL
  • If you’re creative, you can probably accomplish just about anything via WP hooks and plugins and probably do not need to, in most cases, create your own custom WordPress.
  • Do not expect WordPress support to assist you if you’ve significantly modified the core code

That said, you may find a need to have your own custom WordPress install and if that’s the case, this series is for you. Even if not, you may find it interesting anyway. We do some of this at b5media.

Subversion Basics

Subversion is a change control module that keeps track of changes made to a software package. WordPress uses this as a repository for ongoing development and so we use it as a cornerstone of our development.

As I run Mac OS X, I have the benefit of Unix on my laptop and I use the information found in the free SVN ebook. The approach taken in this series is from that perspective. Windows users can dive into TortoiseSVN and find the parallels.

Create a Working Copy

When you’re writing code or patches, you’ll never make the change directly to the repository. In the case of WordPress, unless you’re one of only a handful of individuals, you aren’t allowed to make changes to the core repository. You need to make modifications in a Working Copy then, depending on your permissions for a repository, either check those changes back in (aka, commit) or create a patch (aka a diff) for someone who can check the changes in.

To check out a working copy of WordPress into a working copy, for instance, you would create a folder and grab the latest code base:


macbrain:~/svn aaron$ mkdir wpwc
macbrain:~/svn aaron$ cd wpwc
macbrain:~/svn/wpwc aaron$ svn co http://svn.automattic.com/wordpress/branches/2.1 .
A    wp-pass.php
A    wp-rss.php
A    wp-login.php
A    wp-comments-post.php
A    wp-blog-header.php
A    wp-rdf.php

Making Changes in SVN

Now, you can edit any of these files in your working copy and can produce a patch, or check in your changes (depending on your permissions).

To create a unified diff (the format used in most SVN repositories), make sure you’re in the top level of the working copy and use the diff command:


macbrain:~/svn/wpwc aaron$ svn diff > patch.diff

This will compare the working copy to the repository to determine what the differences are and export those changes to a file called patch.diff. If you open up patch.diff in your favorite text editor, you’ll find that the formatting is ugly and, though human readable, may not make a lot of sense. Don’t worry as these patches don’t have to be applied manually.

The other option for getting changes back into the repository is to check in or commit the changes. The format is as follows:

macbrain:~/svn/wpwc aaron$ svn ci -m "My code changes and bug fixes"

So that’s a low level introduction for interacting with a repository. Tomorrow, we’ll continue looking at SVN and setting up your own repository, then SVN Externals, which allow us to bring in external repositories into your own repository and round it all up with how to customize your build with patches. Stay tuned.

Table of contents for Build Your Own WordPress Repository

  1. Customized WordPress: Understanding Subversion
  2. Customized WordPress: Setting up an SVN Repository
  3. Customized WordPress: SVN Externals
  4. Customized WordPress: Applying Patches to WordPress
  5. Customized WordPress: Reasons for Doing It
Next in series
  • Add to Mixx!
  • Stumble it!
About the Author: Aaron Brazell is the lead editor of Technosailor.com and a social media expert. His passion is to see companies and individuals use the internet and web technologies wisely and effectively to promote their brands and companies. He is Business Development Manager for Lijit and he worked as Director of Technology at b5media from 2005-2008 and is currently an independent consultant.
Tagged: at 10:20 am -
discussion by DISQUS

Add New Comment

  • Subscribe:  This Thread
  • Go to:  My Comments ·  Community Page
  • Thanks. Your comment is awaiting approval by a moderator.

    Do you already have an account? Log in and claim this comment.

    discussion by DISQUS

    Add New Comment

    close Joe Chill(joechill)
    konvict

    status via twitter

    Murdering the Wayne parents, creating Batman · 2 minutes ago

    recent comments (follow comments)

      View Profile »
      Powered by Disqus · Learn more
      blog comments powered by Disqus
      Freshbooks
      • Recent Posts

        • Even During a Recession, Small Businesses Still Should Consider Macbooks
        • Non-Competes in a Down Economy
        • Startup Layoffs — The Unkindest Cut
        • BlogHer Comes to DC, Technosailor.com represents 33% of Male Population
        • Why Pay For a Blog Platform?
      • Recent Comments

        Powered by Disqus
      • Tags

        Aaron Brazell Advertising Apple b5media Blogging book conferences Design entrepreneurship Facebook Finance and Funding Google guest_blogging holidays humor hurricanes_and_natural_disasters interesting job Links Marketing Music nfl Op-Ed Perfect Pitch personal politics pr Predictions productivity Programming Security Social Issues Social Media Social Networking social_issues Sports Tech Industry Technology Technosailor Travel twitter unix Venture Files WordPress you_can_blog

      • License Creative Commons Attribution-Noncommercial-Share Alike 3.0 | Copyright © 2004 - 2008 - Aaron Brazell | Managed Hosting by FastServers.Net.