Basic Concepts

Subversion is a form of source control. Like CVS and Git, Subversion lets you keep track of all the changes you've made to your code. A Subversion repository is a web-accessible archive of those changes. Ever wished you could undo several days' worth of work and roll back to an earlier iteration? If you've kept your local copy in sync with your repository, you can. Furthermore, you can make all those versions—the current release as well as the whole history of the project—available to the public, as shown in Figure 9-10. WordPress plugins and themes are distributed using a Subversion repository, as is the core WordPress software.

Figure 9-10. A plugin page with the stable version and links to other versions

Working with a repository breaks down into three common steps: checking out, updating, and committing. If you're new to Subversion, this will make more sense in the context of an established project, like WordPress itself, rather than the new one you're submitting. Let's say that you wanted to check out a nightly version of WordPress to use as the basis for your development. You'd go to wordpress.org/download/svn/ and locate the address of WordPress's trunk:

core.svn.wordpress.org/trunk/. You'd enter this into your client (covered in more detail later) and check out an initial copy. Then, let's say a week or so later, you realize that there have probably been some updates since you checked out your copy, and you'd like to stay in sync. You'd tell your client to update your copy, and it would download all the files that had changed since your initial checkout. If you had changed any of those files in your local copy, your client would alert you to the conflict and ask you what to do. Now, if you're reading this, I'm guessing that you are probably not a WordPress core developer. If you were, though, you'd be able to upload your changes to the repository, making them available to everyone, by committing your altered files.

That's how Subversion works for an existing project. When you first submit your plugin to Extend, you'll receive the address of your repository, and you'll check out an initial copy. This seems nonsensical, because you haven't submitted anything yet, so what is there to check out?

0 0

Post a comment