com web/rmtools: Reset number of running builds after all are finished: include/Branch.php script/snap.php
| From: | Anatol Belski | Date: | Fri, 15 Sep 2017 19:14:23 +0000 |
| Subject: | com web/rmtools: Reset number of running builds after all are finished: include/Branch.php script/snap.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26406@lists.php.net to get a copy of this message | ||
Commit: 1a51e1d9cc8d8285c3b8360828460b5241274783
Author: Anatol Belski <ab@php.net> Fri, 15 Sep 2017 21:14:23 +0200
Parents: 2b498ff0c5cd112f8e146e9ed5cf93878ffb2b01
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=1a51e1d9cc8d8285c3b8360828460b5241274783
Log:
Reset number of running builds after all are finished
Changed paths:
M include/Branch.php
M script/snap.php
Diff:
diff --git a/include/Branch.php b/include/Branch.php
index c6eefb3..c137038 100644
--- a/include/Branch.php
+++ b/include/Branch.php
@@ -272,6 +272,15 @@ class Branch {
$this->writeData();
}
+ function resetBuildNum()
+ {
+ if (rm\Branch::REQUIRED_BUILDS_NUM <= $branch->numBuildsRunning()) {
+ $this->data = $this->readdata();
+ $this->data->build_num = 0;
+ $this->writeData();
+ }
+ }
+
function numBuildsRunning()
{
return count($this->data->builds);
diff --git a/script/snap.php b/script/snap.php
index 35c089d..eae659c 100644
--- a/script/snap.php
+++ b/script/snap.php
@@ -222,7 +222,7 @@ if ($branch->hasNewRevision() || $branch->hasUnfinishedBuild() || $force)
{
}
$branch->setLastRevisionExported($last_rev);
-
+ $branch->resetBuildNum();
}
out_here: