Пример #1
0
 private function parseOutputLines($outputLines, $limit)
 {
     $this->commits = array();
     $commits = Utilities::pregSplitFlatArray($outputLines, '/^[' . preg_quote('*_|\\ ') . ']+commit (\\w+)$/');
     foreach ($commits as $commitOutputLinesRaw) {
         $commitOutputLines = array();
         if (substr($commitOutputLinesRaw[0], 0, 1) != '*') {
             continue;
         }
         $shift = strpos($commitOutputLinesRaw[0], 'commit');
         foreach ($commitOutputLinesRaw as $line) {
             $commitOutputLines[] = substr($line, $shift);
         }
         $this->commits[] = Commit::createFromOutputLines($this->getRepository(), $commitOutputLines);
         if (count($this->commits) == $limit) {
             break;
         }
     }
 }
Пример #2
0
 /**
  * testCreateFromOutputLines
  */
 public function testCreateFromOutputLines()
 {
     $outputLines = array("commit c277373174aa442af12a8e59de1812f3472c15f5", "tree 9d36a2d3c5d5bce9c6779a574ed2ba3d274d8016", "author John Doe <*****@*****.**> 1326214000 +0100", "committer Jack Doe <*****@*****.**> 1326214100 +0100", "", "    Initial commit");
     $commit = Commit::createFromOutputLines($this->getRepository(), $outputLines);
     $this->doCommitTest($commit, 'c277373174aa442af12a8e59de1812f3472c15f5', '9d36a2d3c5d5bce9c6779a574ed2ba3d274d8016', 'John Doe', 'Jack Doe', '*****@*****.**', '*****@*****.**', '1326214000', '1326214100', 'Initial commit');
 }
Пример #3
0
 private function parseOutputLines($outputLines)
 {
     $commitLines = null;
     $this->rangeCommits = array();
     foreach ($outputLines as $line) {
         if (preg_match('/^commit (\\w+)$/', $line) > 0) {
             if (null !== $commitLines) {
                 $this->rangeCommits[] = Commit::createFromOutputLines($this->getRepository(), $commitLines);
             }
             $commitLines = array();
         }
         $commitLines[] = $line;
     }
     if (null !== $commitLines && count($commitLines) > 0) {
         $this->rangeCommits[] = Commit::createFromOutputLines($this->getRepository(), $commitLines);
     }
 }
Пример #4
0
 private function parseOutputLines($outputLines)
 {
     $this->commits = array();
     $commits = Utilities::pregSplitFlatArray($outputLines, '/^commit (\\w+)$/');
     foreach ($commits as $commitOutputLines) {
         $this->commits[] = Commit::createFromOutputLines($this->getRepository(), $commitOutputLines);
     }
 }