#!/usr/bin/perl # Author: CrawfordCurrie # # This is a developer script, and should *not* be released. # # It must be run from the root of an SVN checkout. It takes a single # parameter which is the number of a revision to merge. # For example: # perl merge.pl 15561 # merge rev 15561 # my $svn = 'http://svn.twiki.org/svn/twiki'; my $rev = shift; $rev =~ s/\D//; die "No rev" unless length($rev); my $changed = `curl -s http://develop.twiki.org/~twiki4/cgi-bin/svnlook?command=changed%20-r%20$rev`; my $cmd = "svn merge -c $rev"; foreach my $file (split(/\n/, $changed)) { next unless $file =~ m#^(\w+)\s*twiki/(\w+/\w+)/(.*)#; my ($cmd, $branch, $file) = ($1, $2, $3); if ($cmd eq 'U') { my $cmd = "svn merge -c $rev $svn/$branch/$file $file"; print `$cmd`; } elsif ($cmd eq 'A') { if (-d $file) { print `mkdir $file`; } else { print `svn cat $svn/$branch/$file > $file`; } print `svn add $file`; } else { print STDERR "Don't know how to merge a $cmd checkin"; } }