Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ishigaki (7238)

  (email not shown publicly)

Journal of ishigaki (7238)

Thursday December 14, 2006
02:14 AM

scriptlet to update files only you've not touched

[ #31905 ]

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.

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.