This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, 6.0 has been updated
via 836656c57b757cf45e35174dfc9b5fd0ceda1237 (commit)
via 24a4b0af91e8bd08b91a42b7b2ed33649abbe844 (commit)
from 2c8b2d82123252365085e0fdb10cb01e57c99d97 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 836656c57b757cf45e35174dfc9b5fd0ceda1237
Author: Franck Villaume <[email protected]>
Date: Tue May 12 11:58:02 2015 +0200
fix PHP obsolete preg_replace /e option => use preg_replace_callback
diff --git a/src/common/include/utils_crossref.php
b/src/common/include/utils_crossref.php
index fa1af09..b9a797d 100644
--- a/src/common/include/utils_crossref.php
+++ b/src/common/include/utils_crossref.php
@@ -4,7 +4,7 @@
*
* Copyright 1999-2001 (c) Alcatel-Lucent
* Copyright 2009, Roland Mas
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2015 Franck Villaume - TrivialDev
*
* This file is part of FusionForge. FusionForge is free software;
* you can redistribute it and/or modify it under the terms of the
@@ -31,16 +31,16 @@ function util_gen_cross_ref ($text, $group_id) {
$text = util_make_links($text);
// Handle gforge [#nnn] Syntax => links to tracker.
- $text = preg_replace('/\[\#(\d+)\]/e', "_artifactid2url('\\1')", $text);
+ $text = preg_replace_callback('/\[\#(\d+)\]/',
create_function('$matches', 'return _artifactid2url($matches[1]);'), $text);
// Handle gforge [Tnnn] Syntax => links to task.
- $text = preg_replace('/\[\T(\d+)\]/e',
"_taskid2url('\\1','$group_id')", $text);
+ $text = preg_replace_callback('/\[\T(\d+)\]/',
create_function('$matches', 'return _taskid2url($matches[1],'.$group_id.');'),
$text);
// Handle [wiki:<pagename>] syntax
- $text = preg_replace('/\[wiki:(.*?)\]/e', "_page2url('$prj','\\1')",
$text);
+ $text = preg_replace_callback('/\[wiki:(.*?)\]/',
create_function('$matches', 'return _page2url('.$prj.',$matches[1]);'), $text);
// Handle [forum:<thread_id>] Syntax => links to forum.
- $text = preg_replace('/\[forum:(\d+)\]/e', "_forumid2url('\\1')",
$text);
+ $text = preg_replace_callback('/\[forum:(\d+)\]/',
create_function('$matches', 'return _forumid2url($matches[1]);'), $text);
return $text;
}
commit 24a4b0af91e8bd08b91a42b7b2ed33649abbe844
Author: Franck Villaume <[email protected]>
Date: Tue May 12 09:25:16 2015 +0200
plugin scmhook: small clean-up, coding style, use existing vars
diff --git a/src/plugins/scmhook/library/scmsvn/hooks/committracker/post.php
b/src/plugins/scmhook/library/scmsvn/hooks/committracker/post.php
index 90b1d4d..7fa2572 100644
--- a/src/plugins/scmhook/library/scmsvn/hooks/committracker/post.php
+++ b/src/plugins/scmhook/library/scmsvn/hooks/committracker/post.php
@@ -6,7 +6,7 @@
* Portions Copyright 2004 (c) Roland Mas <99.roland.mas @nospam@ aist.enst.fr>
* The rest Copyright 2004 (c) Francisco Gimeno <kikov @nospam@ kikov.org>
* Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013,2015 Franck Villaume - TrivialDev
*
* This file is part of FusionForge. FusionForge is free software;
* you can redistribute it and/or modify it under the terms of the
@@ -55,16 +55,15 @@ function usage( $argv ) {
function getInvolvedArtifacts($Log)
{
preg_match_all('/[[]#[\d]+[]]/', $Log, $Matches );
- foreach($Matches as $Match)
- {
+ foreach($Matches as $Match) {
$Result = preg_replace ('/[[]#([\d]+)[]]/', '\1', $Match);
}
return $Result;
}
/**
- * It returns a list of involved artifacts.
- * An artifact is identified if [T(NUMBER)] is found.
+ * It returns a list of involved Tasks.
+ * A task is identified if [T(NUMBER)] is found.
*
* @param string $Log Log message to be parsed.
*
@@ -73,35 +72,12 @@ function getInvolvedArtifacts($Log)
function getInvolvedTasks($Log)
{
preg_match_all ('/[[]T[\d]+[]]/', $Log, $Matches );
- foreach($Matches as $Match)
- {
+ foreach($Matches as $Match) {
$Result = preg_replace ('/[[]T([\d]+)[]]/', '\1', $Match);
}
return $Result;
}
-/**
- * Parse input and get the Log message.
- *
- * @param string $Input Input from stdin.
- *
- * @return array Array of lines of Log Message.
- */
-function getLog($Input)
-{
- $Lines = explode("\n", $Input);
- $ii = count($Lines);
- $Logging=false;
- for ( $i=0; $i < $ii ; $i++ )
- {
- if ($Logging==true)
- $Log.=$Lines[$i]."\n";
- if ($Lines[$i]=='Log Message:')
- $Logging=true;
- }
- return trim($Log);
-}
-
$files = array();
if (count($argv) != 3) {
@@ -116,25 +92,28 @@ USAGE;
$repository = $argv[1];
$revision = $argv[2];
$svn_tracker_debug = 0;
+$svn_tracker_debug_file = sys_get_temp_dir().'scmhook_svn_committracker.debug';
$UserName = trim(`svnlook author -r $revision $repository`); //username of
author
-$date = trim(`svnlook date -r $revision $repository`); //date
-$log = trim(`svnlook log -r $revision $repository`); // the log
-$changed = trim(`svnlook changed -r $revision $repository | sed 's/[A-Z]*
//'`); // the filenames
+$date = trim(`svnlook date -r $revision $repository`); //date
+$log = trim(`svnlook log -r $revision $repository`); // the log
+$changed = trim(`svnlook changed -r $revision $repository | sed 's/[A-Z]*
//'`); // the filenames
if (isset($svn_tracker_debug) && $svn_tracker_debug == 1) {
+ $file = fopen($svn_tracker_debug_file, 'a+');
fwrite($file,"Vars filled:\n");
- fwrite($file,"username : " . $UserName . " \n");
- fwrite($file,"date : " . $date . " \n");
- fwrite($file,"log : " . $log . " \n");
- fwrite($file,"changed : " . $changed . " \n");
+ fwrite($file,"username: " . $UserName . "\n");
+ fwrite($file,"date: " . $date . "\n");
+ fwrite($file,"log: " . $log . "\n");
+ fwrite($file,"changed: " . $changed . "\n");
+ fclose($file);
}
$changed = explode("\n", $changed);
// First check if anything must be done before diving deeper into the svn
history
-$tasks_involved= getInvolvedTasks($log);
-$artifacts_involved= getInvolvedArtifacts($log);
+$tasks_involved = getInvolvedTasks($log);
+$artifacts_involved = getInvolvedArtifacts($log);
if ((!is_array($tasks_involved) || count($tasks_involved) < 1) &&
(!is_array($artifacts_involved) || count($artifacts_involved) < 1)) {
//nothing to post
@@ -161,7 +140,7 @@ foreach ($changed as $onefile) {
}
$files[] = array(
- 'name' => $repository . "/" . $onefile,
+ 'name' => $repository . '/' . $onefile,
'previous' => $prev,
'actual' => $revision
);
@@ -172,17 +151,16 @@ foreach ($changed as $onefile) {
$SubmitUrl = util_make_url('/plugins/scmhook/committracker/newcommit.php');
$i = 0;
-foreach ( $files as $onefile )
-{
- $SubmitVars[$i]["UserName"] = $UserName;
- $SubmitVars[$i]["Repository"] = $repository;
- $SubmitVars[$i]["FileName"] = $onefile['name'];
- $SubmitVars[$i]["PrevVersion"] = $onefile['previous'];
- $SubmitVars[$i]["ActualVersion"] = $onefile['actual'];
- $SubmitVars[$i]["Log"] = $log;
- $SubmitVars[$i]["TaskNumbers"] = getInvolvedTasks($log);
- $SubmitVars[$i]["ArtifactNumbers"] = getInvolvedArtifacts($log);
- $SubmitVars[$i]["SvnDate"] = time();
+foreach ( $files as $onefile ) {
+ $SubmitVars[$i]['UserName'] = $UserName;
+ $SubmitVars[$i]['Repository'] = $repository;
+ $SubmitVars[$i]['FileName'] = $onefile['name'];
+ $SubmitVars[$i]['PrevVersion'] = $onefile['previous'];
+ $SubmitVars[$i]['ActualVersion'] = $onefile['actual'];
+ $SubmitVars[$i]['Log'] = $log;
+ $SubmitVars[$i]['TaskNumbers'] = $tasks_involved;
+ $SubmitVars[$i]['ArtifactNumbers'] = $artifacts_involved;
+ $SubmitVars[$i]['SvnDate'] = time();
$i++;
}
-----------------------------------------------------------------------
Summary of changes:
src/common/include/utils_crossref.php | 10 +--
.../library/scmsvn/hooks/committracker/post.php | 78 +++++++-------------
2 files changed, 33 insertions(+), 55 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits