From 4e609667a9b2545726b8076da2f4504fa0d9c9b1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Oct 2007 14:21:25 -0400 Subject: [PATCH] more leaf dir fixes --- mr | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mr b/mr index b1139e5..3c998f3 100755 --- a/mr +++ b/mr @@ -232,6 +232,7 @@ my @repos; my $nochdir=0; foreach my $topdir (sort keys %config) { foreach my $subdir (sort keys %{$config{$topdir}}) { + next if $subdir eq 'default'; my $dir=$topdir.$subdir; next if $dir ne $directory && $dir !~ /^\Q$directory\E\//; push @repos, [$dir, $topdir, $subdir]; @@ -239,20 +240,20 @@ foreach my $topdir (sort keys %config) { } if (! @repos) { # fallback to find a leaf repo - foreach my $topdir (sort keys %config) { - foreach my $subdir (sort keys %{$config{$topdir}}) { + LEAF: foreach my $topdir (reverse sort keys %config) { + foreach my $subdir (reverse sort keys %{$config{$topdir}}) { + next if $subdir eq 'default'; my $dir=$topdir.$subdir; my $d=$directory; $dir.="/" unless $dir=~/\/$/; $d.="/" unless $d=~/\/$/; if ($d=~/^\Q$dir\E/) { push @repos, [$dir, $topdir, $subdir]; + last LEAF; } } } - if (@repos > 1) { - die "mr: found multiple leaf repos (should never happen)"; - } + $nochdir=1; } my (@failed, @successful, @skipped); -- 2.39.2