X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/8863dd020e175247f423aed1dc63dbe0269af923..d752aeb38d80a8342ba88c5fe5483be61b987182:/mr?ds=sidebyside diff --git a/mr b/mr index 0bded23..59d6a69 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};