Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/protocol/DiffusionSubversionCommandEngine.php
12242 views
1
<?php
2
3
final class DiffusionSubversionCommandEngine
4
extends DiffusionCommandEngine {
5
6
protected function canBuildForRepository(
7
PhabricatorRepository $repository) {
8
return $repository->isSVN();
9
}
10
11
protected function newFormattedCommand($pattern, array $argv) {
12
$flags = array();
13
$args = array();
14
15
$flags[] = '--non-interactive';
16
17
if ($this->isAnyHTTPProtocol() || $this->isSVNProtocol()) {
18
$flags[] = '--no-auth-cache';
19
20
if ($this->isAnyHTTPProtocol()) {
21
$flags[] = '--trust-server-cert';
22
}
23
24
$credential_phid = $this->getCredentialPHID();
25
if ($credential_phid) {
26
$key = PassphrasePasswordKey::loadFromPHID(
27
$credential_phid,
28
PhabricatorUser::getOmnipotentUser());
29
30
$flags[] = '--username %P';
31
$args[] = $key->getUsernameEnvelope();
32
33
$flags[] = '--password %P';
34
$args[] = $key->getPasswordEnvelope();
35
}
36
}
37
38
$flags = implode(' ', $flags);
39
$pattern = "svn {$flags} {$pattern}";
40
41
return array($pattern, array_merge($args, $argv));
42
}
43
44
protected function newCustomEnvironment() {
45
$env = array();
46
47
$env['SVN_SSH'] = $this->getSSHWrapper();
48
49
return $env;
50
}
51
52
}
53
54