Commit a12e3a8b authored by jenkins's avatar jenkins
parents 36505b77 d420319d
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
$git_commit_id = $argv[2]; $git_commit_id = $argv[2];
$first_commit = $argv[3]; $first_commit = $argv[3];
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://reviews.mahara.org/changes/?q=' . $git_commit_id . '&o=LABELS&pp=0'); curl_setopt($ch, CURLOPT_URL, 'https://reviews.mahara.org/changes/?q=' . $git_commit_id . '&o=LABELS&o=CURRENT_REVISION&pp=0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch); $content = curl_exec($ch);
curl_close($ch); curl_close($ch);
...@@ -21,6 +21,12 @@ if ($content[0]->status == 'MERGED') { ...@@ -21,6 +21,12 @@ if ($content[0]->status == 'MERGED') {
exit; exit;
} }
// Check that the patch we are testing is the latest (current) patchset in series
if ($content[0]->current_revision != $git_commit_id) {
echo 3;
exit;
}
// Now check to see if anyone has rejected this. // Now check to see if anyone has rejected this.
// We don't want to reject the patch if auto test has failed as we are re-testing now // We don't want to reject the patch if auto test has failed as we are re-testing now
// but we do want to reject patch if the parent has failed auto test. // but we do want to reject patch if the parent has failed auto test.
......
...@@ -29,6 +29,9 @@ do ...@@ -29,6 +29,9 @@ do
if [ "$outcome" = "1" ]; then if [ "$outcome" = "1" ]; then
echo "The patch with git commit id $line has been rejected" echo "The patch with git commit id $line has been rejected"
exit 1; exit 1;
elif [ "$outcome" = "3" ]; then
echo "The patch with git commit id $line is not the latest (current) patch"
exit 1;
else else
echo "The patch with git commit id $line looks ok so we will continue" echo "The patch with git commit id $line looks ok so we will continue"
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment