コード例 #1
0
ファイル: Svn.php プロジェクト: google-code-backups/xinc
 /**
  * Gets the modified files between two revisions from SVN and puts this info
  * into the ModificationSet_Result.
  *
  * @param Xinc_Plugin_Repos_ModificationSet_Result $result The Result to get
  *  Hash ids from and set modified files.
  *
  * @return void
  * @throw Xinc_Exception_ModificationSet
  */
 protected function getChangeLog(Xinc_Plugin_Repos_ModificationSet_Result $result)
 {
     $arLog = $this->svn->log->run(array($this->task->getDirectory()), array('r' => $result->getLocalRevision() + 1 . ':' . $result->getRemoteRevision()));
     if (isset($arLog['logentry'])) {
         foreach ($arLog['logentry'] as $arEntry) {
             $result->addLogMessage($arEntry['revision'], strtotime($arEntry['date']), $arEntry['author'], $arEntry['msg']);
         }
     } else {
         throw new Xinc_Exception_ModificationSet('SVN get log failed', 0);
     }
 }
コード例 #2
0
ファイル: Git.php プロジェクト: google-code-backups/xinc
 /**
  * Gets the changelog data between two revisions from git and puts this info
  * into the ModificationSet_Result. (This are author, date and commit message.)
  *
  * @param Xinc_Plugin_Repos_ModificationSet_Result $result The Result to get
  *  Hash ids from and set change log data.
  *
  * @return void
  * @throw Xinc_Exception_ModificationSet
  */
 protected function getChangeLog(Xinc_Plugin_Repos_ModificationSet_Result $result)
 {
     $command = $this->git->getCommand('log')->setOption('pretty', 'H:%H%nA:%aN%nD:%aD%nM:%s')->addArgument($result->getLocalRevision() . '..' . $result->getRemoteRevision());
     try {
         $strResult = $command->execute();
     } catch (VersionControl_Git_Exception $e) {
         throw new Xinc_Exception_ModificationSet('GIT get log failed: ' . $e->getMessage(), 0, $e);
     }
     $arCommandLines = explode(PHP_EOL, trim($strResult));
     while (count($arCommandLines)) {
         $strHash = $this->getLogEntry('H', $arCommandLines);
         $strAuthor = $this->getLogEntry('A', $arCommandLines);
         $strDate = $this->getLogEntry('D', $arCommandLines);
         $strMessage = $this->getLogEntry('M', $arCommandLines);
         $result->addLogMessage($strHash, $strDate, $strAuthor, $strMessage);
     }
 }