Changeset View
Changeset View
Standalone View
Standalone View
scripts/repository/commit_hook.php
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | if ($is_svnrevprop) { | ||||
exit($err); | exit($err); | ||||
} else if ($repository->isGit() || $repository->isHg()) { | } else if ($repository->isGit() || $repository->isHg()) { | ||||
$username = getenv(DiffusionCommitHookEngine::ENV_USER); | $username = getenv(DiffusionCommitHookEngine::ENV_USER); | ||||
if (!strlen($username)) { | if (!strlen($username)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'No Direct Pushes: You are pushing directly to a repository hosted '. | 'No Direct Pushes: You are pushing directly to a repository hosted '. | ||||
'by Phabricator. This will not work. See "No Direct Pushes" in the '. | 'by %s. This will not work. See "No Direct Pushes" in the '. | ||||
'documentation for more information.')); | 'documentation for more information.', | ||||
PhabricatorPlatformSite::getName())); | |||||
} | } | ||||
if ($repository->isHg()) { | if ($repository->isHg()) { | ||||
// We respond to several different hooks in Mercurial. | // We respond to several different hooks in Mercurial. | ||||
$engine->setMercurialHook($argv[2]); | $engine->setMercurialHook($argv[2]); | ||||
} | } | ||||
} else if ($repository->isSVN()) { | } else if ($repository->isSVN()) { | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0