Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
Show First 20 Lines • Show All 1,224 Lines • ▼ Show 20 Lines | private function isInitialImport(array $all_updates) { | ||||
// | // | ||||
// - the repository is currently empty; and | // - the repository is currently empty; and | ||||
// - it pushes more than 7 commits at once. | // - it pushes more than 7 commits at once. | ||||
// | // | ||||
// The number "7" is chosen arbitrarily as seeming reasonable. We could | // The number "7" is chosen arbitrarily as seeming reasonable. We could | ||||
// also look at author data (do the commits come from multiple different | // also look at author data (do the commits come from multiple different | ||||
// authors?) and commit date data (is the oldest commit more than 48 hours | // authors?) and commit date data (is the oldest commit more than 48 hours | ||||
// old), but we don't have immediate access to those and this simple | // old), but we don't have immediate access to those and this simple | ||||
// heruistic might be good enough. | // heuristic might be good enough. | ||||
$commit_count = 0; | $commit_count = 0; | ||||
$type_commit = PhabricatorRepositoryPushLog::REFTYPE_COMMIT; | $type_commit = PhabricatorRepositoryPushLog::REFTYPE_COMMIT; | ||||
foreach ($all_updates as $update) { | foreach ($all_updates as $update) { | ||||
if ($update->getRefType() != $type_commit) { | if ($update->getRefType() != $type_commit) { | ||||
continue; | continue; | ||||
} | } | ||||
$commit_count++; | $commit_count++; | ||||
Show All 23 Lines |