Friday, July 21, 2006

switching svn URLs with rsync

I've got an svn working copy of close to 300MB. I'm across the internet from the source and I didn't want to check the whole thing out again. I had originally checked it out with svn+ssh:// but I wanted to switch to svn://. I needed to switch because svn+ssh takes longer than just svn://. The ssh part needs to reconnect with every svn * command, and I didn't want to pay the 2-3 seconds of that ssh negotiation. There might be a way to use a persistent ssh session, but that would look dumb, providing no beneft.

I thought maybe svn switch might do the trick, but after some trial and error, and actually reading The free svn online book show that switch doesn't work the way I thought. While trying stuff out I also looked at --relocate. There's an example of svn switch --relocate here, but that doesn't do what I need either. I'm not moving anything to a branch or elsewhere in the repository, I actually want to change the protocol used to communicate with the repository.

Finally, I fell back on rsync. I use rsync a LOT. It solves a lot of problems that I run across at work (and in the occasional consulting job). For this task, I first did an svn co svn:// checkout *at* the same computer as the repository. This was just so I'd have a working copy with svn://, normally, I use file:/// there.

Once I'd got a checked out copy using svn://, I rsynced that with my remote copy (which used to be svn+ssh://). There was probably something slightly wrong with what I did. It correctly synced the subdirectory .svn directories to use the new protocol, but the root didn't get changed. So I rsynced that .svn directory separately.

Total bandwidth cost of the rsync was around 4MB received and 2MB sent. Since the whole checked out working copy is 327MB, that's quite a savings. It actually took less time to do the rsync than my previous attempt, which was to tar and compress the remotely checked out svn:// working copy. I was then going to scp or rsync the archive over. When the archive blew up to 60MB though (and still going), I gave up on that. I certainly didn't want to copy over 60MB if there was some other way.

Wednesday, July 12, 2006

Switching to ubuntu -- but with icewm

My desktop computer (inherited from my brother-in-law) always had problems with Mandriva 2006 installed on it. These were mainly graphics problems, e.g., on drakconf, rpmdrake, gaim (some KDE programs too, so it wasn't necessarily just GTK), icons in windows would display to the left of where they were supposed to show. This wasn't a big deal at all, but it was irritating. And there was the svk problem (which I solved as below, by installing from CPAN, but it was another thing to worry about).

I thought I'd try some other distribution. I'd installed Ubuntu and Kubuntu at work. There were problems (mainly because we didn't understand what we were doing). Ubuntu and Kubuntu apparently come in one CD only. I'm not sure if they come in DVD or multiple CDs. In any case, at work both installed great looking desktop environments but then we spent some time figuring out how to get postgresql-8, php-5, devel tools, servers etc on there. Now, after looking at the Ubuntu website, it looks like there are different install CDs for desktop and home use.

At work, I didn't really spend enough time to figure out how to do all of that, so we just ignored Ubuntu and we now use debian (with some old versions of software, see above, installed from source or from debian-unstable) for the server and Mandriva or Novell Linux for the desktop.

On my home desktop, though (I've got Mandriva 2006 on DVD, but the computer doesn't have a DVD reader), I first installed debian (via network install, just for kicks). That worked out pretty well, but I decided not to stay with debian-stable because the versions of software on there were just too old for me. I tried debian-unstable, but I gave up on that since I got confused by some things. some things were also, well, unstable but those were just me not knowing what I was doing and getting confused).

I had upgraded to debian-unstable by just changing the apt sources and then upgrading everything automatically. That worked well enough (better than the similar technique would have in Mandriva), but I didn't like something about the whole thing, so I upgraded once more (same technique) to ubuntu. That worked pretty well and, while I had packages from three different versions of debian, I didn't really have any problems. The icons problem went away and the whole thing was much more responsive than it had been under Mandriva.

For the future, I'll be leaning toward ubuntu for my desktop computers. I haven't made up my mind yet about servers.

I don't like Gnome or KDE (preferring, instead, icewm), so the first thing I do after I've gotten a good install (well, I've only done this twice so far, but I'll be doing it a lot more, I bet) is to change the apt sources and install icewm, rxvt, etc, and remove as much of gnome and KDE as possible. I keep individual gnome or KDE applications though (quickly coming to mind are evolution, kuickshow and k3b).

I doubt if I'll go to debian. The distro moves too slowly (postgres-7.4 instead of postgres-8, for instance), and I'll never get anyone to agree to install debian-unstable, just because of that name :-). Ubuntu, though, seems to have just the right amount of development/upgrading velocity. I liked the Mandrake velocity, I don't think I'd be comfortable with gentoo, I *know* I don't want to be using Fedora.

Long ago I switched to mandrake because of urpmi (and later, rpmdrake), and also because of the rate of development. I didn't really need everything that the Mandrake *drake software gave me, but urpmi's automatic dependency handling was great, and the rate of development felt just right.

All of that is still there, so I don't *really* need to switch distributions. The kicker though is that I use svk for working with version-controlled source code when I'm not connected to the internet. And I haven't yet gotten svk to work from the Mandriva packages that are available. Not sure why that is, it's probably just pilot error, but, on the other hand, debian and ubuntu make it dead easy to install svk.

On Mandriva, I usually install svk from CPAN, which is a major pain (that's another rant right there). CPAN has some major problems finding the right protocols and servers to use for installing things, last time I did that I had to figure out what it was trying to do and do them manually, putting the downloaded files where it expected to find them, again, probably pilot error or just not enough deep knowledge of how to configure CPAN installations, but if ubuntu makes something dead easy, I'm switching as long as nothing else I absolutely need is missing.