示例#1
0
 /**
  *
  * @param GitRepository $repository
  * @param int $remote_server_id the id of the server to which we want to migrate
  * @param Boolean $migrate_access_right if the acess right will be migrated or not
  * @param int $gerrit_template_id the id of template if any chosen
  */
 public function migrateToGerrit(GitRepository $repository, $remote_server_id, $gerrit_template_id)
 {
     if ($repository->canMigrateToGerrit()) {
         try {
             $this->gerrit_server_factory->getServerById($remote_server_id);
             $this->git_system_event_manager->queueMigrateToGerrit($repository, $remote_server_id, $gerrit_template_id);
             $this->history_dao->groupAddHistory("git_repo_to_gerrit", $repository->getName(), $repository->getProjectId());
         } catch (Exception $e) {
             $this->logger->log($e->getMessage(), Feedback::ERROR);
         }
     }
 }
示例#2
0
 public function itIsMigratableIfItHasAlreadyBeenAGerritRepoInThePastAndRemoteProjectIsDeleted()
 {
     $repo = new GitRepository();
     $repo->setBackendType(GitDao::BACKEND_GITOLITE);
     $repo->setRemoteServerDisconnectDate(12345677890);
     $repo->setRemoteProjectDeletionDate(12345677890);
     $repo->setRemoteServerId(4154);
     $this->assertTrue($repo->canMigrateToGerrit());
 }