source: lab/trunk/TipAndDoc/tools/svn/hooks/start-commit @ 117

Last change on this file since 117 was 117, checked in by mitty, 13 years ago
  • add svn:executables
  • Property svn:executable set to *
File size: 1.1 KB
Line 
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.