1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| #!/usr/bin/perl
#===============================================================================
# Author :
# Date :
# Main :
#===============================================================================
use Carp;
use strict;
use warnings;
use vars qw($VERSION);
$VERSION = '1.00';
GetOptions(
"depot=s" => \$depot,
"depot_path=s" => \$url,
"project_name=s" => \$ProjNom,
"project_path=s" => \$ProjChemin,
"import_project" => \$AjoutProj,
"checkout=s" => \$CopTravail,
"add=s" => \$AjoutModif,
"update" => \$MiseAJour,
"commit=s" => \$Deployer,
"revert" => \$Annul,
"delete=s" => \$Supp,
"help" => \$help,
"branche=s" => \$branche,
"merge" => \$fusion,
"default" => \$default,
);
my $Project = SVN::Agent->load( { path => $ProjChemin } );
# Option --default
if ( defined $default ) {
# URL définie
if ( defined $url ) {
$DepotPath = $url;
}
# Tu définis tes variables en dur
else {
$DepotPath = 'URL/DEPOT';
}
}
elsif ($depot) {
mkpath [ "$depot", 1 ];
system "svnadmin create $url";
}
elsif ($branche) {
system 'svn copy '
. "file:///$url/$ProjNom/Trunk/ "
. "file:///$url/$ProjNom/Branches/$branche/ "
. '-m '
. "\" création d'une branche pour une nouvelle version \"";
}
elsif ($help) {
print "HELP";
}
elsif ($AjoutProj) {
system "svn import $ProjChemin file:///$url/$ProjNom -m \"Import initial\"";
}
elsif ($CopTravail) {
if ( $CopTravail eq '' ) {
system "svn checkout file:///$url/$ProjNom";
}
system "svn checkout file:///$url/$ProjNom/$CopTravail";
}
__END__ |
Partager