X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/8863dd020e175247f423aed1dc63dbe0269af923..b56d4742d0ab350800aad62ce671b7a968be0448:/mr diff --git a/mr b/mr index 0bded23..357b2d2 100755 --- a/mr +++ b/mr @@ -239,8 +239,7 @@ repositories be processed earlier, and larger values to make repositories be processed later. Note that if a repository is located in a subdirectory of another -repository, ordering it to be processed earlier is not recommended, as this -can cause confusion during checkouts. +repository, ordering it to be processed earlier is not recommended. =item chain @@ -287,7 +286,6 @@ $SIG{INT}=sub { $ENV{MR_CONFIG}="$ENV{HOME}/.mrconfig"; my $config_overridden=0; -my $directory=getcwd(); my $verbose=0; my $stats=0; my $no_recurse=0; @@ -296,6 +294,7 @@ my %config; my %configfiles; my %knownactions; my %alias; +my $directory=getcwd(); Getopt::Long::Configure("no_permute"); my $result=GetOptions( @@ -311,6 +310,9 @@ if (! $result || @ARGV < 1) { "(Use mr help for man page.)\n"); } +if (! defined $directory) { + die("mr: failed to determine working directory\n"); +} # Make sure MR_CONFIG is an absolute path, but don't use abs_path since # the config file might be a symlink to elsewhere, and the directory it's @@ -448,7 +450,7 @@ foreach my $repo (@list) { } if (! @repos) { # fallback to find a leaf repo - foreach my $repo (@list) { + foreach my $repo (reverse @list) { my $topdir=$repo->{topdir}; my $subdir=$repo->{subdir}; @@ -473,7 +475,6 @@ if ($jobs > 1) { else { foreach my $repo (@repos) { record($repo, action($action, @$repo)); - print "\n"; } } if (! @ok && ! @failed && ! @skipped) { @@ -651,7 +652,6 @@ sub mrs { #{{{ waitpid($active[$i][0], 0); print STDOUT $out[$i][0]; print STDERR $out[$i][1]; - print "\n"; record($active[$i][1], $? >> 8); splice(@fhs, $i, 1); splice(@active, $i, 1); @@ -672,9 +672,11 @@ sub record { #{{{ if ($ret == OK) { push @ok, $dir; + print "\n"; } elsif ($ret == FAILED) { push @failed, $dir; + print "\n"; } elsif ($ret == SKIPPED) { push @skipped, $dir;