#!/usr/bin/env perl # This software is released under the same license and terms as perl # itself. # # This is a script for running svn add and svn remove interactively # using the output of svn status. Run it from any subversion checkout. use strict; use warnings; my @status_lines = `svn status`; chomp(@status_lines); foreach (@status_lines) { my $flag = substr($_, 0, 1); my $path = $_; $path =~ s/^.[ ]+//; if ($flag eq "?") { print "Add $path? [yes] "; my $response = ; chomp($response); if ($response ne "n" and $response ne "no") { `svn add $path`; } } elsif ($flag eq "!") { print "Remove $path? [yes] "; my $response = ; chomp($response); if ($response ne "n" and $response ne "no") { `svn remove $path`; } } }