compile/update hook: enable new style personal branches
The new style personal branches work by interpreting the special sequence /USER/ (including the slashes) in a refname. Docs should be in the next commit...
This commit is contained in:
parent
ed5c78349e
commit
83884aa758
|
@ -39,6 +39,7 @@ die "parse $ENV{GL_RC} failed: " . ($! or $@) unless do $ENV{GL_RC};
|
||||||
our $creater = $ENV{GL_CREATER};
|
our $creater = $ENV{GL_CREATER};
|
||||||
our $readers = $ENV{GL_READERS};
|
our $readers = $ENV{GL_READERS};
|
||||||
our $writers = $ENV{GL_WRITERS};
|
our $writers = $ENV{GL_WRITERS};
|
||||||
|
our $gl_user = $ENV{GL_USER};
|
||||||
|
|
||||||
die "parse $GL_CONF_COMPILED failed: " . ($! or $@) unless do $GL_CONF_COMPILED;
|
die "parse $GL_CONF_COMPILED failed: " . ($! or $@) unless do $GL_CONF_COMPILED;
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,7 @@ sub parse_acl
|
||||||
our $creater = $ENV{GL_CREATER} = $c || $ENV{GL_CREATER} || "NOBODY";
|
our $creater = $ENV{GL_CREATER} = $c || $ENV{GL_CREATER} || "NOBODY";
|
||||||
our $readers = $ENV{GL_READERS} = $r || $ENV{GL_READERS} || "NOBODY";
|
our $readers = $ENV{GL_READERS} = $r || $ENV{GL_READERS} || "NOBODY";
|
||||||
our $writers = $ENV{GL_WRITERS} = $w || $ENV{GL_WRITERS} || "NOBODY";
|
our $writers = $ENV{GL_WRITERS} = $w || $ENV{GL_WRITERS} || "NOBODY";
|
||||||
|
our $gl_user = $ENV{GL_USER};
|
||||||
|
|
||||||
die "parse $GL_CONF_COMPILED failed: " . ($! or $@) unless do $GL_CONF_COMPILED;
|
die "parse $GL_CONF_COMPILED failed: " . ($! or $@) unless do $GL_CONF_COMPILED;
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,7 @@ sub parse_conf_file
|
||||||
# fully qualify refs that dont start with "refs/" or "NAME/";
|
# fully qualify refs that dont start with "refs/" or "NAME/";
|
||||||
# prefix them with "refs/heads/"
|
# prefix them with "refs/heads/"
|
||||||
@refs = map { m(^(refs|NAME)/) or s(^)(refs/heads/); $_ } @refs;
|
@refs = map { m(^(refs|NAME)/) or s(^)(refs/heads/); $_ } @refs;
|
||||||
|
@refs = map { s(/USER/)(/\$gl_user/); $_ } @refs;
|
||||||
|
|
||||||
# expand the user list, unless it is just "@all"
|
# expand the user list, unless it is just "@all"
|
||||||
@users = expand_list ( @users )
|
@users = expand_list ( @users )
|
||||||
|
@ -367,7 +368,7 @@ my $dumped_data = Data::Dumper->Dump([\%repos], [qw(*repos)]);
|
||||||
# the dump uses single quotes, but we convert any strings containing $creater,
|
# the dump uses single quotes, but we convert any strings containing $creater,
|
||||||
# $readers, $writers, to double quoted strings. A wee bit sneaky, but not too
|
# $readers, $writers, to double quoted strings. A wee bit sneaky, but not too
|
||||||
# much...
|
# much...
|
||||||
$dumped_data =~ s/'(?=[^']*\$(?:creater|readers|writers))(.*?)'/"$1"/g;
|
$dumped_data =~ s/'(?=[^']*\$(?:creater|readers|writers|gl_user))(.*?)'/"$1"/g;
|
||||||
print $compiled_fh $dumped_data;
|
print $compiled_fh $dumped_data;
|
||||||
close $compiled_fh or die "$ABRT close compiled-conf failed: $!\n";
|
close $compiled_fh or die "$ABRT close compiled-conf failed: $!\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue