Last active
December 16, 2015 22:39
Revisions
-
Cerdic revised this gist
May 25, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -67,4 +67,6 @@ function exect($c,$echo=true){ exect("cat log.txt"); $c = "svn commit $dest -F log.txt"; // echo $c."\n"; // autocomit si pas de conflit : exect($c); -
Cerdic revised this gist
May 11, 2013 . 1 changed file with 29 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,22 @@ function exect($c,$echo=true){ return $output; } // s'assurer qu'on a pas de modifs locales sur la cible avant de merger $output=""; exec($c="svn status --ignore-externals $dest",$output); foreach($output as $o){ if (strncmp($o,"C ",2)==0 OR strncmp($o,"M ",2)==0 OR strncmp($o,"D ",2)==0 OR strncmp($o,"! ",2)==0 ){ exect($c); echo "Report impossible sur $dest : Il y a des modifs locales en attente\n"; die(); } } // up exect("svn up --ignore-externals $source $dest",false); @@ -34,13 +50,21 @@ function exect($c,$echo=true){ $log = trim(implode("\n",$output)); exect("svn merge ".str_replace("-r","-c",$revision)." $source $dest"); $log = "Report de ".trim($revision,"-")." : ".$log; file_put_contents("log.txt",$log); $output = exect("svn status --ignore-externals $dest"); // Regarder si il y a des conflits ou anomalies suite au merge foreach($output as $o){ if (strncmp($o,"C ",2)==0 OR strncmp($o,"! ",2)==0 ){ echo "/!\ Erreurs/Conflits lors du merge a resoudre avant de comit\n"; die(); } } exect("cat log.txt"); $c = "svn commit $dest -F log.txt"; echo $c."\n"; -
Cerdic created this gist
May 3, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ #!/usr/bin/php <?php // Report d'un commit d'un repertoire sur un autre // le script fait le merge svn et prepare le log de comit dans log.txt // mais ne fait pas le commit automatiquement car risque de conflits // il faut le faire suivre de la commande comit manuelle si le diff est OK // Syntaxe : // cherry-pick.php -rNNNN source dest // // exemple d'utilisation : // ./cherry-pick.php -r20468 branches/spip-3.0/ spip/ // svn commit spip/ -F log.txt $revision = $argv[1]; $source = $argv[2]; $dest = $argv[3]; function exect($c,$echo=true){ $output=""; if ($echo) echo $c."\n"; exec($c,$output); if ($echo) echo implode("\n",$output)."\n"; return $output; } // up exect("svn up --ignore-externals $source $dest",false); // log $output = exect("svn log $revision $source"); array_shift($output); array_shift($output); array_pop($output); $log = trim(implode("\n",$output)); exect("svn merge ".str_replace("-r","-c",$revision)." $source $dest"); exect("svn status --ignore-externals $dest"); $log = "Report de ".trim($revision,"-")." : ".$log; file_put_contents("log.txt",$log); exect("cat log.txt"); $c = "svn commit $dest -F log.txt\n"; #$c = "svn commit $dest -m\"Report de ".trim($revision,"-")." : ".addcslashes($log,'"')."\""; echo $c."\n";