Пример #1
0
 /**
  * Get the revision message
  * @return string
  */
 public function getMessage()
 {
     return $this->commit->getMessage();
 }
Пример #2
0
 protected function auditEvent(Commit $new_head, Commit $old_head = null, $by = null)
 {
     if (($fn = $this->getAuditFile()) && ($file = \fopen($fn, 'a'))) {
         // event name
         $event = '';
         if (!$old_head) {
             $event = 'INIT';
         } elseif ($new_head->getSha() == $old_head->getSha()) {
             $event = 'RESET';
         } elseif ($new_head->getDatetimeAuthor() > $old_head->getDatetimeAuthor()) {
             $event = 'UPDATE';
         } else {
             $event = 'ROLLBACK';
         }
         if ($new_head->getSha() == $this->getRepo()->getCommit($this->branch_name)) {
             $event .= ' TO LATEST';
         }
         $audit = new Audit($by ?: '-', $event, $old_head ? sprintf('%s @ %s - %s', $old_head->getSha(true), $old_head->getDatetimeAuthor()->format('Ymd_Hi'), $old_head->getMessage()) : null, sprintf('%s @ %s - %s', $new_head->getSha(true), $new_head->getDatetimeAuthor()->format('Ymd_Hi'), $new_head->getMessage()));
         \fwrite($file, $audit->serialize() . "\n");
         \fclose($file);
     }
 }