Updated: July 26th, 2010
This is a quick recipe that I found pretty interesting and relatively unknown.
Everyone who uses SVN knows that most repositories are set up to allow viewing of their contents via a web browser. For example, here's the trunk of WP Plugins SVN: http://plugins.svn.wordpress.org/ and here is the current trunk version of a specific file, let's say http://plugins.svn.wordpress.org/stats/trunk/readme.txt.
The Problem
However, what if you wanted to view a specific revision of a file or directory in your browser?
Let's say I wanted revision 100,000 of http://plugins.svn.wordpress.org/stats/trunk/readme.txt
Normally, on a command line, you'd do something like
svn co http://plugins.svn.wordpress.org/stats/trunk/readme.txt stats cd stats; svn up -r100000 readme.txt |
or simply
How To Properly Set SVN svn:externals Property In SVN Command Line
Updated: October 6th, 2009
Introduction
Every time I have to deal with svn:externals in SVN, I forget the command line syntax. Every single damn time. Normally, I use SVN GUI clients, such as SmartSVN, which make it very simple to add an svn:externals property. But for command line, it always takes looking at 25 different sites on google, which are all incredibly unhelpful for this question for some reason. Trying "svn help propset" on the command line was bloated and equally useless.
So this time I needed to write it down and make sure everyone who needed help with svn:externals would find exactly what they need here. I hope this page will soon come up on top of all the unhelpful results on …
Updated: October 6th, 2009
No matter what programming language you use, there comes a time when you need to search for a file somewhere on the file system. Here, I want to talk about accomplishing this task in Perl. There are many ways of doing so, most of them boring, but I want to discuss the fun and elegant way – using File::Find::Rule.
Let me briefly discuss some of the other methods first.
Limited
Using glob() (or <>, TODO verify) you can find files in a single directory, using only the limited shell wildcard support. For example,
1 |
my @files = glob("tmp*"); |
…
How To Check If The Local SVN Revision Is Up-To-Date
I've encountered a problem recently where I had to figure out if some checked out code is up-to-date with the svn repository, without actually running svn update. Unfortunately, svn update doesn't have a dry-run option, so I had to find another solution.
I came up with 2, depending on how detailed the information needs to be, which I'm about to share in this post.
1. If you want exact file and directory names, you can run:
svn status -u |
If any files need updating, you will see a * before the file name.
svn status wc M wc/bar.c A + wc/qax.c |
If you're like me, most of your WordPress plugins are checked out into your plugins directory from the official WordPress SVN repository or some other one. I haven't updated any of mine for about a month and wanted to sync up everything quickly (including SVN externals). Here's a short command I ran to achieve that:
1 2 |
cd YOUR_BLOG_ROOT/wp-content/plugins; find . -maxdepth 1 -type d -exec svn up {} \; |
What this command does is finds the top level directories in your WordPress plugins directory, then applies the "svn update" command to each, one by one.
The result is something like