X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/e9de7f196a3b998952e8f62acb04a18d9f087d8a..ef1db305643600d7f7cb21e60d57c01c428e7a4e:/mr?ds=inline diff --git a/mr b/mr index bed4cac..4243194 100755 --- a/mr +++ b/mr @@ -166,6 +166,14 @@ If the "chain" parameter is set and its command returns nonzero, then B will try to load a .mrconfig file from the root of the repository. (You should avoid chaining from repositories with untrusted committers.) +=item deleted + +If the "deleted" parameter is set and its command returns nonzero, then +B will treat the repository as deleted. It won't ever actually delete +the repository, but it will warn if it sees the repsoitory's directory. +This is useful when one mrconfig file is shared amoung multiple machines, +to keep track of and remember to delete old repositories. + =item lib The "lib" parameter can specify some shell code that will be run before each @@ -286,6 +294,22 @@ sub action { my $lib= exists $config{$topdir}{$subdir}{lib} ? $config{$topdir}{$subdir}{lib}."\n" : ""; + if (exists $config{$topdir}{$subdir}{deleted}) { + if (! -d $dir) { + next; + } + else { + my $test="set -e;".$lib.$config{$topdir}{$subdir}{deleted}; + print "mr $action: running deleted test >>$test<<\n" if $verbose; + my $ret=system($test); + if ($ret >> 8 == 0) { + print STDERR "mr error: $dir should be deleted yet still exists\n\n"; + push @failed, $dir; + return; + } + } + } + if ($action eq 'checkout') { if (-d $dir) { print "mr $action: $dir already exists, skipping checkout\n" if $verbose;