Example #1
0
 public static function Select(Database $database, SelectionConstraints $constraints, $flag)
 {
     $query = self::QueryBase($flag);
     $query .= '
   FROM
     tracking_revisions
   LEFT JOIN
     tracking_authors ON tracking_authors.author_id = tracking_revisions.author_id
   ' . self::FlaggedJoinStatement($flag) . '
   WHERE
     ' . implode(' AND ', $constraints->constraints()) . '
   ORDER BY
     ' . $constraints->orderField() . ' ' . $constraints->order() . '
   LIMIT
     ' . $constraints->limit();
     return self::SelectCommitQuery($database, $query);
 }
Example #2
0
//
// "flag"            Numeric Id for identifying a set of persistent selections.
// "since_flag"      Limit selected commits to those made since the last flag.
if (isset($_REQUEST['flag']) && is_numeric($_REQUEST['flag'])) {
    $flagged->setFlag(intval($_REQUEST['flag']));
    if (isset($_REQUEST['since_flag'])) {
        $most_recent_flag = $flagged->findMostRecentFlagTime();
        if ($most_recent_flag !== false) {
            $constraints->setEarliestCommitDate(date('Y-m-d H:i:s', $most_recent_flag));
            $constraints->setLatestCommitDate(date('Y-m-d H:i:s'));
        }
    }
}
// Ensure that at least one constraint has been set, because otherwise we'll end
// up selecting all hundreds of thousands of commits in the database.
if (count($constraints->constraints()) == 0) {
    $constraints->setEarliestCommitDate(date('Y-m-d H:i:s', time() - 7 * 86400));
}
// Select the commits from the database based on the |$constraints|. The
// returned object may be used as an iterator.
$commits = CommitSelection::Select($database, $constraints, $flagged->flag());
// Hard-coded array of the filters which should be enabled for the selection
// list. At some point I may want to make this controllable using settings.
$filters = array('FlagRevertFilter', 'RemoveGitDependencySyncFilter', 'RemoveV8TagsFilter', 'RemoveSkiaRebaselineFilter', 'RemoveSkiaHousekeeperFilter');
?>
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title><?php 
echo $constraints->pageTitle();