<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>Frederick&#039;s Timelog &#187; Subversion</title> <atom:link href="http://www.frederickding.com/posts/tag/subversion/feed/" rel="self" type="application/rss+xml" /><link>http://www.frederickding.com</link> <description>News, technology, life, and more.</description> <lastBuildDate>Fri, 23 Jul 2010 21:04:19 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1-alpha</generator> <item><title>Subversion for Beginners</title><link>http://www.frederickding.com/posts/2009/06/subversion-for-beginners-30332/</link> <comments>http://www.frederickding.com/posts/2009/06/subversion-for-beginners-30332/#comments</comments> <pubDate>Tue, 30 Jun 2009 22:37:32 +0000</pubDate> <dc:creator>Frederick</dc:creator> <category><![CDATA[Computer Matters]]></category> <category><![CDATA[software]]></category> <category><![CDATA[Subversion]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://www.frederickding.com/?p=332</guid> <description><![CDATA[I mentioned previously that I wanted to post how Subversion works (on the surface, for beginners) and how I use it for my development needs. To create my WordPress plugins, Simpler iPaper and Simpler CSS, using SVN has been a must; after all, the only way to release new versions of the plugins is through [...]]]></description> <content:encoded><![CDATA[<p>I mentioned previously that I wanted to post how Subversion works (on the surface, for beginners) and how I use it for my development needs.</p><p>To create my WordPress plugins, <a href="http://wordpress.org/extend/plugins/simpler-ipaper/">Simpler iPaper</a> and <a href="http://wordpress.org/extend/plugins/simpler-css/">Simpler CSS</a>, using <abbr title="Subversion">SVN</abbr> has been a must; after all, the only way to release new versions of the plugins is through SVN. I also keep this site&#8217;s WordPress installation up-to-date on the development version using Subversion. Additionally, in my current efforts to develop a working solution for HDTV&#8217;s in business and organizational settings, <a href="http://code.google.com/p/display-ui/">Display UI</a> is being developed using Subversion for <strong>version control</strong>.</p><p>You get the idea. I use it on a daily basis, and for practical purposes. I don&#8217;t claim to understand the fine details, but hopefully this post gives you an idea of <em>how</em> I use it and how you can, too.</p><p><a href="http://www.flickr.com/photos/kleinman/3002341233/"><img class="alignright size-full wp-image-334" style="margin: 5px;" title="Source Code Snapshot" src="http://content.fjd.me/2009/06/source-code-snapshot-20090630.jpg" alt="Source Code Snapshot" width="300" height="400" /></a>So what <em>is</em> version control? Simply put, it&#8217;s a way of keeping track of the changes made to files. It&#8217;s often impractical to make manual backups of a file before every set of changes to it, so version control systems like <acronym title="Concurrent Versions System">CVS</acronym> and <abbr title="Subversion">SVN</abbr> emerged to help people — especially developers and programmers — keep track of their files, share changes with team members, and prevent stupid mistakes.</p><p>Accidentally deleted your code? <strong>Revert</strong> your changes. Came up with an ingenious way (that works) to do something? <strong>Commit</strong> your changes. Need to get the latest <strong>revision</strong> of all the files? <strong>Update</strong> the working copy.</p><p>Perhaps the most practical application of systems like Subversion is in team development. When three or more people are working on the same set of files, it&#8217;s useful to be able to merge the changes seamlessly, see the changes others have made, or even work separately on <em>branches</em> (kind of like forks) and <em>tags</em> (usually released versions that are being maintained).</p><p>I <em>did</em> write that I don&#8217;t claim to understand the fine details. If you really want to understand Subversion, I <em>highly</em> recommend this book by members of the development team: <a href="http://www.amazon.com/gp/product/0596510330?ie=UTF8&#038;tag=frederick-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596510330">Version Control with Subversion</a>, or <a href="http://svnbook.red-bean.com/">the book online</a>.</p><p>Let&#8217;s talk about how to use it. Hard-core programmers often choose to use the command line tools, where they type commands like <code>svn up</code> to update the files. Beginners will be glad to know that there are implementations with <acronym title="Graphical User Interface">GUI</acronym>&#8216;s, like <a href="http://rapidsvn.tigris.org/">RapidSVN</a> and <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a>. <a href="http://www.eclipse.org/">Eclipse</a> users may use <a href="http://www.eclipse.org/subversive/">Subversive</a> or <a href="http://subclipse.tigris.org/">Subclipse</a>, &#8220;team providers&#8221; that let coders easily perform version control tasks inside the <acronym title="Integrated Development Environment">IDE</acronym>.</p><div class="wp-caption aligncenter" style="width: 317px"><a href="http://tortoisesvn.tigris.org/images/ContextMenuDirControl.png" class="thickbox no_icon" rel="gallery-332" title="TortoiseSVN Context Menu"><img title="TortoiseSVN Context Menu" src="http://tortoisesvn.tigris.org/images/ContextMenuDirControl.png" alt="Subversion tasks can be done in Windows Explorer" width="307" height="528" /></a><p class="wp-caption-text">Subversion tasks can be done in Windows Explorer</p></div><p>Assuming that you&#8217;re using the command line binaries — which you can <a href="http://subversion.tigris.org/getting.html#binary-packages">get from the Subversion site</a>, and I recommend official CollabNet builds where possible — most of the basic tasks are rather easy.</p><p>Instead of right-clicking and picking options from a menu, tasks are done by typing commands.</p><p>First of all, a &#8216;repository&#8217; is a hosted location containing all of the code, revisions and metadata. Often, one can access a repository via HTTP, as in the case of WordPress, which is found at <a href="http://core.svn.wordpress.org/">http://core.svn.wordpress.org/</a> .</p><p>To &#8216;checkout&#8217; a repository means to make a local copy (known as a &#8216;working copy&#8217;) of the contents. That&#8217;s what we have to do first when working with an established project: get the code from the repository.</p><p>To do so, type the following at an open shell (on Linux/Mac OS X) or command prompt: (<strong>don&#8217;t type the &#8216;$&#8217;</strong> — that&#8217;s just what you should see at the start of every command line in Bash)</p><pre class="brush: bash; light: true;">$ svn checkout http://core.svn.wordpress.org/trunk/ wordpress/</pre><p>Windows users would do the same, but at a command prompt — again, without the dollar sign.</p><p>That command invokes the <code>svn</code> executable and tells it to checkout the WordPress trunk directory to the local folder <code>wordpress</code>.</p><span id="more-332"></span><p>Once you&#8217;ve done that, you&#8217;ve got a working copy, which you can update to the latest at any time after making sure your current directory is the working copy</p><pre class="brush: bash; light: true;">$ cd wordpress
$ svn update</pre><p><code>svn update</code> can be shortened to <code>svn up</code>.</p><p>Now go ahead and delete the index.php file in the working copy. It&#8217;s conceivable that one might accidentally do this at some point. (On Linux/Mac OS X, one would type <code>rm index.php</code>, whereas on Windows, the <code>del</code> command is used instead.)</p><p>No worries. You have an option here: revert or update. Reverting will simply undo your local changes to the last downloaded revision, while updating will fetch the newest version of the deleted index.php file from the repository. Go ahead, get it back!</p><pre class="brush: bash; light: true;">$ svn revert index.php</pre><p>What about making some changes to the files and committing them to the repository? In these examples, we&#8217;ve been using WordPress, to which anonymous users don&#8217;t have write access. I&#8217;ll still show you how a change is committed, regardless.</p><p>After making your change, type the following (where filename is, obviously, the actual filename).</p><pre class="brush: bash; light: true;">$ svn commit filename</pre><p>This usually opens up the system default editor (often vim on Unix systems), into which one enters a log message; that&#8217;s used as the log message when you save and quit the editor. In case you&#8217;re on Windows or some weird Linux distribution, this might not work for you, so you&#8217;ll have to specify another flag.</p><pre class="brush: bash; light: true;">$ svn commit --message=&quot;Change summary&quot; filename
Sending        filename
Transmitting file data .
Committed revision 1234.</pre><p>(Here the dollar sign is useful to indicate lines of user input vs. lines of output — the second to fourth lines are output, without the dollar sign.)</p><p>By this point you&#8217;ve done the most common tasks with Subversion: committing and updating. What about adding new files to the repository? After all, you&#8217;ll have to do that at <em>some</em> point.</p><p>After, for example, creating the file <code>asdf.txt</code> inside the working copy, we only need to make Subversion aware of its existence. Type the following command, and you&#8217;ll get the desired result.</p><pre class="brush: bash; light: true;">$ svn add asdf.txt
A        asdf.txt</pre><p>To remove the file, it&#8217;s best that the removal is done through the Subversion executable, since it needs to keep track of all the files and <em>could be confused</em> if it can&#8217;t find the file. (Here I&#8217;m using the <code>--force</code> flag because the change hasn&#8217;t been committed.)</p><pre class="brush: bash; light: true;">$ svn rm --force asdf.txt
D        asdf.txt</pre><p>That&#8217;s as much as most beginners need to know about Subversion. Of course, I make use of properties all the time, occasionally tag releases, and sometimes lock and unlock files.</p><p>If you want to learn more about the specifics of Subversion, try <a href="http://svnbook.red-bean.com/">reading the book I mentioned online</a>. It&#8217;s an excellent resource, and can be complemented by other books such as <a href="http://www.amazon.com/gp/product/1590597532?ie=UTF8&#038;tag=frederick-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1590597532">Practical Subversion, Second Edition</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=geekieorgatec-20&amp;l=as2&amp;o=1&amp;a=1590597532" border="0" alt="" width="1" height="1" /></p><p>… that was a long post. I hope it enriched your knowledge.</p>]]></content:encoded> <wfw:commentRss>http://www.frederickding.com/posts/2009/06/subversion-for-beginners-30332/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Yay for WordPress 2.8 Release Candidate</title><link>http://www.frederickding.com/posts/2009/06/yay-for-wordpress-2.8-release-candidate-07302/</link> <comments>http://www.frederickding.com/posts/2009/06/yay-for-wordpress-2.8-release-candidate-07302/#comments</comments> <pubDate>Mon, 08 Jun 2009 02:56:53 +0000</pubDate> <dc:creator>Frederick</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[blogging]]></category> <category><![CDATA[software]]></category> <category><![CDATA[Subversion]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://www.frederickding.com/posts/2009/06/yay-for-wordpress-2.8-release-candidate-07302/</guid> <description><![CDATA[Awesome! WordPress has just released the release candidate of WordPress 2.8, which seems to contain an awesome amount of improvements over WordPress 2.7 (most of them subtle and unexposed to the end user). I&#8217;ve been running the trunk version of WordPress for months now, and I have to say that WordPress 2.8 is stable and [...]]]></description> <content:encoded><![CDATA[<p>Awesome! WordPress has just released <a href="http://wordpress.org/development/2009/06/wordpress-2-8-release-candidate-1/">the release candidate of WordPress 2.8</a>, which seems to contain an awesome amount of improvements over WordPress 2.7 (most of them subtle and unexposed to the end user). I&#8217;ve been running the trunk version of WordPress for months now, and I have to say that WordPress 2.8 is stable and usable.</p><p>If you want to stay up-to-date with WordPress, you can try running it from SVN. I&#8217;ll post a little guide on how I do it soon.</p> ]]></content:encoded> <wfw:commentRss>http://www.frederickding.com/posts/2009/06/yay-for-wordpress-2.8-release-candidate-07302/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Served from: www.frederickding.com @ 2010-07-31 09:17:48 by W3 Total Cache -->