new sugar 'legacy-delegation-abort', enabled by default

This commit is contained in:
Sitaram Chamarty 2012-03-18 20:41:02 +05:30
parent 20fd0d0c19
commit 4c1017a529
3 changed files with 28 additions and 1 deletions

View file

@ -216,6 +216,7 @@ __DATA__
SYNTACTIC_SUGAR => SYNTACTIC_SUGAR =>
[ [
# 'continuation-lines', # 'continuation-lines',
'legacy-delegation-abort',
], ],
# comment out or uncomment as needed # comment out or uncomment as needed

View file

@ -7,7 +7,7 @@
# taken as the group name. # taken as the group name.
sub sugar_script { sub sugar_script {
trace( 2, "running 'keysubdirs-as-groups' sugar script..." ); Gitolite::Common::trace( 2, "running 'keysubdirs-as-groups' sugar script..." );
my $lines = shift; my $lines = shift;
my @out = @{$lines}; my @out = @{$lines};

View file

@ -0,0 +1,26 @@
# vim: syn=perl:
# "sugar script" (syntactic sugar helper) for gitolite3
# Aborts if you appear to be using legacy delegation.
# Note: you cannot fix this using sugar; subconf processing has already
# happened by the time it gets to this point.
# TODO: supply doc keyword, and that doc should tell people to add this to the
# end of the main conf file:
# repo gitolite-admin
# - NAME/ = @all
# subconf "fragments/*.conf"
sub sugar_script {
Gitolite::Common::trace( 2, "running 'legacy-delegation-warn' sugar script..." );
my $lines = shift;
my $text = join("\n", @$lines);
if ($text =~ m(NAME/conf/fragments/) and $text !~ /^subconf /m) {
die "\t**** ABORT ****\nYou may be using legacy delegation; see docs\n";
}
return $lines;
}