X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/1c1951da6ff532d6d5961858181a87d34b78b346..a324b0f8a1067d637087d4d94b463d3b9ac84ee8:/mr diff --git a/mr b/mr index b503fa7..4dd3a07 100755 --- a/mr +++ b/mr @@ -415,9 +415,13 @@ to keep track of and remember to delete old repositories. =item lib -The "lib" parameter can specify some shell code that will be run before each -command, this can be a useful way to define shell functions for other commands -to use. +The "lib" parameter can specify some shell code that will be run +before each command, this can be a useful way to define shell +functions for other commands to use. + +Unlike most other parameters, this can be specified multiple times, in +which case the chunks of shell code are accumulatively concatenated +together. =item fixups @@ -426,14 +430,7 @@ is checked out, or updated. This provides an easy way to do things like permissions fixups, or other tweaks to the repository content, whenever the repository is changed. -=item pre_ and post_ - -If a "pre_action" parameter is set, its command is run before mr performs the -specified action. Similarly, "post_action" parameters are run after mr -successfully performs the specified action. For example, "pre_commit" is -run before committing; "post_update" is run after updating. - -=back +=item VCS_action When looking for a command to run for a given action, mr first looks for a parameter with the same name as the action. If that is not found, it @@ -447,6 +444,21 @@ the action that is performed for a given version control system, you can override these VCS specific actions. To add a new version control system, you can just add VCS specific actions for it. +=item pre_ and post_ + +If a "pre_action" parameter is set, its command is run before mr performs the +specified action. Similarly, "post_action" parameters are run after mr +successfully performs the specified action. For example, "pre_commit" is +run before committing; "post_update" is run after updating. + +=item _append + +Any parameter can be suffixed with C<_append>, to add an additional value +to the existing value of the parameter. In this way, actions +can be constructed accumulatively. + +=back + =head1 UNTRUSTED MRCONFIG FILES Since mrconfig files can contain arbitrary shell commands, they can do @@ -1287,8 +1299,8 @@ sub loadconfig { if ($section eq 'ALIAS') { $alias{$parameter}=$value; } - elsif ($parameter eq 'lib') { - $config{$dir}{$section}{lib}.=$value."\n"; + elsif ($parameter eq 'lib' or $parameter =~ s/_append$//) { + $config{$dir}{$section}{$parameter}.="\n".$value."\n"; } else { $config{$dir}{$section}{$parameter}=$value;