From 4496f723056b09b8d1dc17a40d0406232b58c646 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Oct 2007 16:14:57 -0400 Subject: [PATCH] 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. --- mr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; } -- 2.39.5