source: lab.git/TipAndDoc/tools/svn/hooks/start-commit @ a1439aa

trunk
Last change on this file since a1439aa was 7e593aa, checked in by mitty <mitty@…>, 14 years ago
  • add svn:executables

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@117 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

  • Property mode set to 100755
File size: 1.1 KB
RevLine 
[e135cc7]1#!/usr/bin/perl -w
2
3# START-COMMIT HOOK
4#
5#   [1] REPOS-PATH   (the path to this repository)
6#   [2] USER         (the authenticated user attempting to commit)
7#   [3] CAPABILITIES (a colon-separated list of capabilities reported
8#                     by the client; see note below)
9#
10# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5
11# clients will typically report at least the "mergeinfo" capability.
12# If there are other capabilities, then the list is colon-separated,
13# e.g.: "mergeinfo:some-other-capability" (the order is undefined).
14#
15
16my $repospath     = $ARGV[0];
17my $user          = $ARGV[1];
18my $capabilities  = $ARGV[2];
19
20# CAPABILITIES is a colon-separated list of svn client capabilities
21if (! defined $capabilities) {
22    print STDERR "commit fail: you must use Subversion 1.5 or later\n";
23    exit 1;
24}
25
26my @capabilities  = split /:/, $capabilities;
27
28foreach my $parameter ( @capabilities ){
29    $capabilities{ $parameter }++;
30}
31
32if( $capabilities{ "mergeinfo" } ){
33    exit 0;
34}
35else{
36    print STDERR "commit fail: you must use Subversion 1.5 or later\n";
37    exit 1;
38}
Note: See TracBrowser for help on using the repository browser.