trunk
        
      
      
        
  | Rev | Line |   | 
|---|
| [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 |  | 
|---|
 | 16 | my $repospath     = $ARGV[0]; | 
|---|
 | 17 | my $user          = $ARGV[1]; | 
|---|
 | 18 | my $capabilities  = $ARGV[2]; | 
|---|
 | 19 |  | 
|---|
 | 20 | # CAPABILITIES is a colon-separated list of svn client capabilities | 
|---|
 | 21 | if (! defined $capabilities) { | 
|---|
 | 22 |     print STDERR "commit fail: you must use Subversion 1.5 or later\n"; | 
|---|
 | 23 |     exit 1; | 
|---|
 | 24 | } | 
|---|
 | 25 |  | 
|---|
 | 26 | my @capabilities  = split /:/, $capabilities; | 
|---|
 | 27 |  | 
|---|
 | 28 | foreach my $parameter ( @capabilities ){ | 
|---|
 | 29 |     $capabilities{ $parameter }++; | 
|---|
 | 30 | } | 
|---|
 | 31 |  | 
|---|
 | 32 | if( $capabilities{ "mergeinfo" } ){ | 
|---|
 | 33 |     exit 0; | 
|---|
 | 34 | } | 
|---|
 | 35 | else{ | 
|---|
 | 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.