#!/usr/bin/perl # Created:20070613 # By Jeff Connelly # # Emulate svn rm --keep-local after svn rm'ing from the repository # use File::Basename; our ($svn) = "sudo svn"; our ($tmp) = "/tmp/svn-unversion"; our ($log); mkdir($tmp); sub modified_files { my (@mods); while(`$svn status` =~ m/^M\s+(.*)/gm) { push @mods, $1; } return @mods; } sub unversion { my ($file) = @_; my ($tmp_file) = "$tmp/" . basename($file); print "«" . (" " x 10) . "$file\n"; system("mv", $file, $tmp_file); die "couldn't move $file to $tmp_file (out of the way): $?" if $?; system("$svn rm $file"); die "couldn't svn rm $file: $?" if $?; print "»" . (" " x 10) . "$file\n"; system("mv", "$tmp_file", $file); die "couldn't move $tmp_file to $file (restore): $?" if $?; $log .= "$file\n"; } if (!@ARGV) { print <