| <?php |
| /******************************************************************************* |
| * Copyright (c) 2011 Eclipse Foundation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Wayne Beaton (Eclipse Foundation)- initial API and implementation |
| *******************************************************************************/ |
| |
| header("Content-type: text/plain"); |
| |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); |
| $App = new App(); |
| |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Project.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/debug.php"); |
| trace_file_info(__FILE__); |
| |
| $projects = getActiveProjects(); |
| |
| $total = 0; |
| $withRepos = 0; |
| $git = 0; |
| $allRepos = array(); |
| $gitRepos = array(); |
| |
| foreach($projects as $project) { |
| $repositories = $project->getUniqueSourceRepositories(); |
| $total++; |
| if ($repositories) $withRepos++; |
| foreach ($repositories as $repository) { |
| $allRepos[$repository->getName()] = $repository; |
| if ($repository->getType() == 'git') $gitRepos[$repository->getName()] = $repository; |
| } |
| if (isGitProject($project)) { |
| $id = $project->getId(); |
| echo "$id\n"; |
| $git++; |
| } |
| } |
| |
| $gitCount = count($gitRepos); |
| $allCount = count($allRepos); |
| |
| echo "# $git/$withRepos projects migrated to git.\n"; |
| echo "# Total of $total projects.\n"; |
| echo "# $gitCount/$allCount Git repositories.\n"; |
| |
| function isGitProject($project) { |
| foreach ($project->getUniqueSourceRepositories() as $repository) { |
| /* @var $repository SourceRepository */ |
| if ($repository->getType() != 'git') continue; |
| return true; |
| } |
| return false; |
| } |
| |
| ?> |