@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 52 lines 1.2 kB view raw
1<?php 2 3final 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}