<?php namespace Transvision; use Cache\Cache; use VCS\Git; use VCS\Mercurial; use VCS\Subversion; foreach (Project::getRepositories() as $repo) { // Get the right locale for this repo $locale = Project::getLocaleInContext($page_locale, $repo); // We don't care about en-US if ($locale == 'en-US') { continue; } if (in_array($locale, Project::getRepositoryLocales($repo))) { $ref_locale = Project::getReferenceLocale($repo); // Get VCS data $repo_vcs = VersionControl::VCSRepoName($repo); $repo_path = $repo_vcs . '/' . $locale; switch (VersionControl::getVCS($repo)) { case 'hg': $vcs = new Mercurial(HG . $repo_path); break; case 'svn': $vcs = new Subversion(SVN . $repo_path); break; case 'git': $vcs = new Git(GIT . $repo_path); break; }
/** * Check that the repository asked for is one we support * * @param string $repository Name of the repository * @param boolean $alias Do we allow aliases for repository names, * ex: 'global', to query all repositories. Default to False * @return boolean True if we support this repository, False if we don't */ private function verifyRepositoryExists($repository, $alias = false) { $this->valid_repositories = $alias ? array_merge(Project::getRepositories(), ['global']) : Project::getRepositories(); if (!in_array($repository, $this->valid_repositories)) { $this->log("The repo queried ({$repository}) doesn't exist."); return false; } return true; }
/** * Check that the repository asked for is one we support * * @param string $repository Name of the repository * @return boolean True if we support this repository, False if we don't */ private function verifyRepositoryExists($repository) { if (!in_array($repository, Project::getRepositories())) { $this->log("The repo queried ({$repository}) doesn't exist."); return false; } return true; }
public function testGetRepositories() { $obj = new _Project(); $repos = ['release', 'beta', 'aurora', 'central', 'gaia_1_3', 'gaia_1_4', 'gaia_2_0', 'gaia_2_1', 'gaia', 'mozilla_org']; $this->array($obj->getRepositories())->isEqualTo($repos); }