diff --git a/src/lib/Gitolite/Conf/Load.pm b/src/lib/Gitolite/Conf/Load.pm index c696388..9a09793 100644 --- a/src/lib/Gitolite/Conf/Load.pm +++ b/src/lib/Gitolite/Conf/Load.pm @@ -32,6 +32,7 @@ our $data_version = ''; our %repos; our %one_repo; our %groups; +our %patterns; our %configs; our %one_config; our %split_conf; @@ -326,8 +327,10 @@ sub memberships { } } - for my $i ( keys %groups ) { - if ( $base eq $i or $base =~ /^$i$/ or $base2 and ( $base2 eq $i or $base2 =~ /^$i$/ ) ) { + push @ret, @{ $groups{$base} } if exists $groups{$base}; + push @ret, @{ $groups{$base2} } if $base2 and exists $groups{$base2}; + for my $i ( keys %{ $patterns{groups} } ) { + if ( $base =~ /^$i$/ or $base2 and ( $base2 =~ /^$i$/ ) ) { push @ret, @{ $groups{$i} }; } } diff --git a/src/lib/Gitolite/Conf/Store.pm b/src/lib/Gitolite/Conf/Store.pm index 252bf14..2a38a72 100644 --- a/src/lib/Gitolite/Conf/Store.pm +++ b/src/lib/Gitolite/Conf/Store.pm @@ -288,6 +288,8 @@ sub store_common { my $cc = "conf/gitolite.conf-compiled.pm"; my $compiled_fh = _open( ">", "$cc.new" ); + my %patterns = (); + my $data_version = glrc('current-data-version'); trace( 3, "data_version = $data_version" ); print $compiled_fh Data::Dumper->Dump( [$data_version], [qw(*data_version)] ); @@ -301,7 +303,17 @@ sub store_common { my %groups = %{ inside_out( \%groups ) }; $dumped_data = Data::Dumper->Dump( [ \%groups ], [qw(*groups)] ); print $compiled_fh $dumped_data; + + # save patterns in %groups for faster handling of multiple repos, such + # as happens in the various POST_COMPILE scripts + for my $k (keys %groups) { + $patterns{groups}{$k} = 1 unless $k =~ $REPONAME_PATT; + } } + + $dumped_data = Data::Dumper->Dump( [ \%patterns ], [qw(*patterns)] ) if %patterns; + print $compiled_fh $dumped_data; + print $compiled_fh Data::Dumper->Dump( [ \%split_conf ], [qw(*split_conf)] ) if %split_conf; close $compiled_fh or _die "close compiled-conf failed: $!\n"; diff --git a/src/lib/Gitolite/Rc.pm b/src/lib/Gitolite/Rc.pm index 58fc4db..9c2ae5b 100644 --- a/src/lib/Gitolite/Rc.pm +++ b/src/lib/Gitolite/Rc.pm @@ -58,7 +58,7 @@ $UNSAFE_PATT = qr([`~#\$\&()|;<>]); # find the rc file and 'do' it # ---------------------------------------------------------------------- -my $current_data_version = "3.0"; +my $current_data_version = "3.2"; my $rc = glrc('filename'); if (-r $rc and -s $rc) { diff --git a/t/sequence.t b/t/sequence.t index acccb0b..e98690b 100755 --- a/t/sequence.t +++ b/t/sequence.t @@ -55,7 +55,7 @@ try " confreset;confadd ' @staff = u1 u2 u3 - @gfoo = foo/CREATOR/.+ + @gfoo = foo/CREATOR/..* repo @gfoo C = u1 RW+ = CREATOR