Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/ArcanistSubversionAPI.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Interfaces with Subversion working copies. | * Interfaces with Subversion working copies. | ||||
| * | |||||
| * @group workingcopy | |||||
| */ | */ | ||||
| final class ArcanistSubversionAPI extends ArcanistRepositoryAPI { | final class ArcanistSubversionAPI extends ArcanistRepositoryAPI { | ||||
| protected $svnStatus; | protected $svnStatus; | ||||
| protected $svnBaseRevisions; | protected $svnBaseRevisions; | ||||
| protected $svnInfo = array(); | protected $svnInfo = array(); | ||||
| protected $svnInfoRaw = array(); | protected $svnInfoRaw = array(); | ||||
| protected $svnDiffRaw = array(); | protected $svnDiffRaw = array(); | ||||
| private $svnBaseRevisionNumber; | private $svnBaseRevisionNumber; | ||||
| private $statusPaths = array(); | private $statusPaths = array(); | ||||
| public function getSourceControlSystemName() { | public function getSourceControlSystemName() { | ||||
| return 'svn'; | return 'svn'; | ||||
| } | } | ||||
| public function getMetadataPath() { | public function getMetadataPath() { | ||||
| static $svn_dir = null; | static $svn_dir = null; | ||||
| if ($svn_dir === null) { | if ($svn_dir === null) { | ||||
| // from svn 1.7, subversion keeps a single .svn directly under | // from svn 1.7, subversion keeps a single .svn directly under | ||||
| // the working copy root. However, we allow .arcconfigs that | // the working copy root. However, we allow .arcconfigs that | ||||
| // aren't at the working copy root. | // aren't at the working copy root. | ||||
| foreach (Filesystem::walkToRoot($this->getPath()) as $parent) { | foreach (Filesystem::walkToRoot($this->getPath()) as $parent) { | ||||
| $possible_svn_dir = Filesystem::resolvePath('.svn', $parent); | $possible_svn_dir = Filesystem::resolvePath('.svn', $parent); | ||||
| if (Filesystem::pathExists($possible_svn_dir)) { | if (Filesystem::pathExists($possible_svn_dir)) { | ||||
| $svn_dir = $possible_svn_dir; | $svn_dir = $possible_svn_dir; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | final class ArcanistSubversionAPI extends ArcanistRepositoryAPI { | ||||
| } | } | ||||
| public function primeSVNDiffResult($path, $result) { | public function primeSVNDiffResult($path, $result) { | ||||
| $this->svnDiffRaw[$path] = $result; | $this->svnDiffRaw[$path] = $result; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getSVNInfo($path) { | public function getSVNInfo($path) { | ||||
| if (empty($this->svnInfo[$path])) { | if (empty($this->svnInfo[$path])) { | ||||
| if (empty($this->svnInfoRaw[$path])) { | if (empty($this->svnInfoRaw[$path])) { | ||||
| $this->svnInfoRaw[$path] = $this->buildInfoFuture($path)->resolve(); | $this->svnInfoRaw[$path] = $this->buildInfoFuture($path)->resolve(); | ||||
| } | } | ||||
| list($err, $stdout) = $this->svnInfoRaw[$path]; | list($err, $stdout) = $this->svnInfoRaw[$path]; | ||||
| if ($err) { | if ($err) { | ||||
| ▲ Show 20 Lines • Show All 368 Lines • Show Last 20 Lines | |||||