From: Joey Hess Date: Thu, 11 Oct 2007 20:14:57 +0000 (-0400) Subject: run skip test before chdir X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/4496f723056b09b8d1dc17a40d0406232b58c646?hp=cec9366aea873ebe2dca710d42f78d080c7d1ff0 run skip test before chdir To avoid ugly "can't chdir" failures for repos that will be skipped. The $MR_REPO variable can still be used by skip tests. --- diff --git a/mr b/mr index 470927a..5c9d6a3 100755 --- a/mr +++ b/mr @@ -298,10 +298,6 @@ sub action { } $ENV{MR_REPO}=$dir; - if (! $nochdir && ! chdir($dir)) { - print STDERR "mr $action: failed to chdir to $dir: $!\n"; - push @skipped, $dir; - } if (exists $config{$topdir}{$subdir}{skip}) { my $test="set -e;".$lib.$config{$topdir}{$subdir}{skip}; @@ -313,8 +309,12 @@ sub action { return; } } - - if (! exists $config{$topdir}{$subdir}{$action}) { + + if (! $nochdir && ! chdir($dir)) { + print STDERR "mr $action: failed to chdir to $dir: $!\n"; + push @failed, $dir; + } + elsif (! exists $config{$topdir}{$subdir}{$action}) { print STDERR "mr $action: no defined $action command for $topdir$subdir, skipping\n"; push @skipped, $dir; }