Support SVN pre-commit hoooks
Summary: Ref T4189. This adds SVN support, which was a little more messy than I though. Principally, we can not use `PHABRICATOR_USER` for Subversion, because it strips away the entire environment for "security reasons". Instead, use `--tunnel-user` plus `svnlook author` to figure out the author. Also fix "ssh://" clone URIs, which needs to be "svn+ssh://". Test Plan: - Made SVN commits through the hook. - Made Git commits, too, to make sure I didn't break anything. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T4189 Differential Revision: https://secure.phabricator.com/D7683
This commit is contained in:
@@ -173,7 +173,12 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||
$serve_ssh = $repository->getServeOverSSH();
|
||||
if ($serve_ssh !== $serve_off) {
|
||||
$uri = new PhutilURI(PhabricatorEnv::getProductionURI($repo_path));
|
||||
$uri->setProtocol('ssh');
|
||||
|
||||
if ($repository->isSVN()) {
|
||||
$uri->setProtocol('svn+ssh');
|
||||
} else {
|
||||
$uri->setProtocol('ssh');
|
||||
}
|
||||
|
||||
$ssh_user = PhabricatorEnv::getEnvConfig('diffusion.ssh-user');
|
||||
if ($ssh_user) {
|
||||
|
||||
Reference in New Issue
Block a user