scriptlet to update files only you've not touched

ishigaki on 2006-12-14T07:14:51

If you have some large subversion repository, and you're too lazy (or you are not allowed) to make working branches, and still you're longing to update files you aren't touching (ie. simple 'svn up' doesn't work for you), this kind of scriptlet might help you.

#!/usr/bin/perl use strict;

chdir $ARGV[0] if @ARGV;

my $status = `svn status -u`;

foreach my $line ( split /\n/, $status ) { next if $line =~ /^[M?]/; if ( my ($file) = $line =~ /^\s+\*\s+\d+\s+(.+)$/ ) { print "updating $file\n"; system("svn up $file") and die "failed to update $file: $!"; } }


Of course I'm lazy enough to register this to Windows' Task Scheduler ;) I might wrap this with 'for' loop to auto-update multiple repositories I've checked out.