From bc14d897bc2435ceadc98bbc8c662f96aec43fb3 Mon Sep 17 00:00:00 2001
From: alfsb
Date: Tue, 12 Apr 2016 00:27:12 -0300
Subject: [PATCH 1/3] Patch download link directly from cron mails.
---
diffRaw.php | 32 ++++++++++++++++++++++++++++++
scripts/cron/send_work_to_list.php | 1 +
2 files changed, 33 insertions(+)
create mode 100644 diffRaw.php
diff --git a/diffRaw.php b/diffRaw.php
new file mode 100644
index 00000000..3e8b10fd
--- /dev/null
+++ b/diffRaw.php
@@ -0,0 +1,32 @@
+setProject( $req_proj );
+
+$data = RepositoryFetcher::getInstance()->getRawWork( $req_lang );
+
+for( $i = 0 ; $i diff();
+ $diff = implode( "\n" , $diff );
+
+ print $diff;
+ exit;
+}
+
+print "No patch found. project:$req_proj lang:$req_lang idDB:$req_iddb\n";
+
diff --git a/scripts/cron/send_work_to_list.php b/scripts/cron/send_work_to_list.php
index f7e95962..dd1f7665 100644
--- a/scripts/cron/send_work_to_list.php
+++ b/scripts/cron/send_work_to_list.php
@@ -103,6 +103,7 @@
$msg .= "\n
=> Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=".$data['PatchesForReview']['data'][$i]['idDB']."
=> Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=".$data['PatchesForReview']['data'][$i]['idDB']."
+ => Raw patch: https://edit.php.net/diffRaw.php?project=php&lang=".$lang."&idDB=".$data['PatchesForReview']['data'][$i]['idDB']."
";
$msg .="\n";
From ca9acb5cb2e04f1a6cf924e199cd000e3d10aaf7 Mon Sep 17 00:00:00 2001
From: alfsb
Date: Tue, 12 Apr 2016 02:30:43 -0300
Subject: [PATCH 2/3] Clear log output.
---
scripts/cron/send_work_to_list.php | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/scripts/cron/send_work_to_list.php b/scripts/cron/send_work_to_list.php
index dd1f7665..7f4c68aa 100644
--- a/scripts/cron/send_work_to_list.php
+++ b/scripts/cron/send_work_to_list.php
@@ -26,7 +26,7 @@
continue;
}
- echo "enter into ".$project['code']."\n";
+ echo "project ".$project['code']."\n";
// We must delete this var to be re-generated
unset($rm->existingLanguage);
@@ -39,12 +39,11 @@
// For all language, we check the build
foreach ($existingLanguage as $lang) {
- echo "Is there some work to send to the ".$lang["code"]." list ?\n";
-
$lang = $lang["code"];
- $data = $rf->getRawWork($lang);
+ echo " language $lang\n";
+ $data = $rf->getRawWork($lang);
// What we must do when the build failed
//if( $data["total"] != 0 ) {
@@ -131,9 +130,8 @@
// We send an email for this failed build
AccountManager::getInstance()->email($to, $subject, $msg, $to, 'list');
- echo "email send !\n";
-
- }
+ echo " sent email to $to\n";
+ }
}
}
?>
From 922e4392f784bb8d5664c1dc61f8cd3a98af63e7 Mon Sep 17 00:00:00 2001
From: alfsb
Date: Tue, 12 Apr 2016 02:33:56 -0300
Subject: [PATCH 3/3] is not set if lock fails.
---
php/RepositoryManager.php | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/php/RepositoryManager.php b/php/RepositoryManager.php
index 698f84bb..23cf872c 100644
--- a/php/RepositoryManager.php
+++ b/php/RepositoryManager.php
@@ -118,7 +118,6 @@ public function isValidLanguage($lang)
}
}
return false;
-
}
@@ -134,10 +133,10 @@ public function checkoutRepository()
$lock = new LockFile('project_' . $project . '_lock_checkout_repository');
- if ($lock->lock()) {
- // exec the checkout
+ if ($lock->lock())
$rtn = VCSFactory::getInstance()->checkout();
- }
+ else
+ $rtn = array();
$lock->release();