/**
  * Create revision log.
  *
  * @param string    $repository_url       Repository url.
  * @param Connector $repository_connector Repository connector.
  * @param ConsoleIO $io                   Console IO.
  */
 public function __construct($repository_url, Connector $repository_connector, ConsoleIO $io = null)
 {
     $this->_io = $io;
     $this->_repositoryConnector = $repository_connector;
     $this->_repositoryRootUrl = $repository_connector->getRootUrl($repository_url);
     $relative_path = $repository_connector->getRelativePath($repository_url);
     $this->_projectPath = $repository_connector->getProjectUrl($relative_path) . '/';
     $this->_refName = $repository_connector->getRefByPath($relative_path);
 }
Exemple #2
0
 /**
  * Queries missing revision data.
  *
  * @param integer $from_revision From revision.
  * @param integer $to_revision   To revision.
  *
  * @return void
  */
 private function _queryRevisionData($from_revision, $to_revision)
 {
     $range_start = $from_revision;
     $project_url = $this->_repositoryConnector->getProjectUrl($this->_repositoryUrl);
     $progress_bar = $this->_io->createProgressBar(ceil(($to_revision - $from_revision) / 1000));
     $progress_bar->setFormat(' * Reading missing revisions: %current%/%max% [%bar%] %percent:3s%%');
     $progress_bar->start();
     while ($range_start < $to_revision) {
         $range_end = min($range_start + 1000, $to_revision);
         $command = $this->_repositoryConnector->getCommand('log', '-r ' . $range_start . ':' . $range_end . ' --xml --verbose --use-merge-history {' . $project_url . '}');
         $this->_parseLog($command->run());
         $range_start = $range_end + 1;
         $progress_bar->advance();
     }
     $progress_bar->finish();
     $this->_io->writeln('');
 }
 /**
  * @dataProvider getProjectUrlDataProvider
  */
 public function testGetProjectUrl($repository_url)
 {
     $this->assertEquals('svn://user@domain.com/path/to/project', $this->_repositoryConnector->getProjectUrl($repository_url));
 }