Exemplo n.º 1
0
 /**
  * Updates local svn to the remoteRevision for this test.
  *
  * @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 update(Xinc_Plugin_Repos_ModificationSet_Result $result)
 {
     $arUpdate = $this->svn->update->run(array($this->task->getDirectory()), array('r' => $result->getRemoteRevision()));
     if (false === $arUpdate) {
         throw new Xinc_Exception_ModificationSet('SVN update local working copy failed', 0);
     }
 }
Exemplo n.º 2
0
 /**
  * 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);
     }
 }