Recovering Subversion passwords

Tags:

Subversion caches the passwords you give it, in plain-text files with hex-code-hash-value names, in a hidden directory under your home. You can see them all with:

$ <strong>cat ~/.subversion/auth/*</strong>

Naturally, this only works if you store your passwords without encryption... the file will contain at least this, in Key / Value pairs:

K 8
passtype
V 6
simple
V 30
<http://example.com:80> example.com
K 8
username
V 13
<em>your-username</em>
K 8
password
V 13
<em>your-password</em>

SVN tricks

Tags:

To compare the current working copy with other versions, or just to see what other tagged versions are available, it is handy to know the revision number, which is what svn bases all its operations on. The best way to do this is with the long (verbose) form of svn ls as shown below. Note, I am in the 'trunk' directory of my AutoNav project.

bill@charcoal:trunk$ <strong>svn ls -v ../tags</strong>
 327606 wlindley              Dec 31 11:41 ./
 175035 wlindley              Nov 18  2009 1.1.8/
 175037 wlindley              Nov 18  2009 1.1.9/
 187455 wlindley              Dec 27  2009 1.2.2/
 192298 wlindley              Jan 10  2010 1.2.3/
 193267 wlindley              Jan 12  2010 1.2.4/
 195857 wlindley              Jan 20  2010 1.2.5/
 283374 wlindley              Aug 31 14:03 1.2.7/
 287447 wlindley              Sep 09 13:31 1.2.8/
 307532 wlindley              Nov 03 14:52 1.2.9/
 308944 wlindley              Nov 07 12:57 1.3.0/
 311196 wlindley              Nov 13 16:28 1.3.1/
 312023 wlindley              Nov 15 22:33 1.3.2/
 320048 wlindley              Dec 07 06:34 1.3.3/
 320583 wlindley              Dec 08 11:05 1.3.4/
 327606 wlindley              Dec 31 11:41 1.3.5/
bill@charcoal:trunk$

The revision numbers are at left. Now I can do:

bill@charcoal:trunk$ svn diff -r 320583
Index: autonav-wl.php
===================================================================
--- autonav-wl.php      (revision 320583)
+++ autonav-wl.php      (working copy)
@@ -4,7 +4,7 @@
 Plugin URI: http://www.wlindley.com/webpage/autonav
 Description: Displays child pages in a table of images or a simple list; also displays
attached images, or images from a subdirectory under wp-uploads, in a table, with
automatic resizing of thumbnails and full-size images.
 Author: William Lindley
-Version: 1.3.3
+Version: 1.3.6
 Author URI: http://www.wlindley.com/
 */
            <em>and so on</em>

It sure would be nice if there were a way to combine both local working copy and a remote tag in an svn diff command, but that does not seem to be suppported yet (as of svn 1.6).

see also Other svn tricks here [gnu.org]

Updating Subversion in Centos 5.5

Tags:

Interacting with modern Subversion repositories requires a modern copy. Centos 5.5, and other previous versions however, have rather old copies. My server reported (typed text underlined) --

# <span style="text-decoration: underline;">rpm -qa|grep subversion</span>
subversion-1.4.2-4.el5_3.1

The first step is to disable the yum-priorities plugin, if you are using it. If it exists, edit the file /etc/yum/pluginconf.d/priorities.conf and set enabled=0 -- you may want to change it back after you are done here.

Now let's see which subversion we have installed.

<code>  $ rpm -qa|grep subversion
    subversion-1.4.2-4.el5_3.1
</code>

Ah, right. Version 1.4.2 ... We want at least 1.5.

Install the rpmforge repository, following the CentOS instructions. There are the commands I used, you will want to verify the latest version.

# <span style="text-decoration: underline;">wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm</span>
# <span style="text-decoration: underline;">rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt</span>
# <span style="text-decoration: underline;">rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm</span>
# <span style="text-decoration: underline;">rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm</span>

RPMs that overwrite base CentOS modules have been removed from the main rpmforge repository, and put into the rpmforge-extras repository. Unfortunately that is disabled by default, and it is less than obvious how to enable it. The setting is in /etc/yum.repos.d/rpmforge.repo ... Look for this stanza and change the enabled line:

[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/extras
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
<strong>enabled = 1</strong>
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

After this, you can just do a regular yum update or you can manually do just the one:

<pre style="padding-left: 30px;"><code>$ yum --enablerepo=rpmforge check-update subversion
subversion   </code>subversion-1.6.15-0.1.el5.rfx<code>         rpmforge
</code>

Comparing Wordpress Versions

Tags:

This morning I saw a critical update to WordPress ... and wondered what had actually changed.

When you need to compare the installed version of Wordpress (or any program, really) with a different version in the official repository, Subversion can help, although it is not exactly obvious. Here is the incantation:

svn diff --old=. --new=http://core.svn.wordpress.org/tags/3.0.4

With subversion 1.5 or later, you can use the shortcut:

svn diff --old=. --new=^/tags/3.0.4

Or to compare the current version to the new main 'trunk' --

$ svn diff --old=. --new=^/trunk

Subversion Update Tips

Tags:

Subversion has been an excellent tool for version control, but certainly with its own frustrations.

One of these has been knowing where you are (or, rather, your working copy is) in relation to what is what's on the server's repository.

Version 1.5, approximately, introduced a few changes which make this much simpler. At least with v1.6 you can do this, assuming you are in a subdirectory under one in svn control:

$ <strong>svn ls ^/tags</strong>
1.5/
[...]
3.0/
3.0.1/
3.0.2/
3.0.3/
$

Huzzah! Subversion replaces the caret with "the root URL of the repository for this checkout" -- I sure wish I had known this a lot earlier. Now I can see what other tagged versions are available.

Some of you may have guessed my working copy was of Wordpress. Here's how we can see exactly what's going on in a particular tagged version, without actually checking it out:

$ <strong>svn ls ^/tags/3.0.3/wp-includes/ -v</strong>
 16803 westi                 Dec 08 10:50 ./
 13211 nacin                 Feb 18  2010 Text/
 8149 westi           10928 Jun 20  2008 atomlib.php
 15148 nacin           11549 Jun 05  2010 author-template.php
 12525 ryan             9624 Dec 23  2009 bookmark-template.php
[...]

Ah, you say, but I have the tagged version I want... I just want to know what will happen if I type svn update ...? Well try this:

$ <strong>svn diff -r HEAD</strong>

That will show you the differences between your current working copy and the latest edition (head) of the currently checked out version... which is the differences that will be applied if you did an update.

OK, now I'm ready to switch my version... this used to be a bit of a pain, having to copy the URL... but now we can just do:

$ <strong>svn sw ^/tags/3/0.3</strong>
<em>or maybe</em>
$ <strong>svn sw ^/trunk</strong>