Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistLandWorkflow.php
| Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | if ($this->isGit) { | ||||
| if (preg_match($pattern, $fullname, $matches)) { | if (preg_match($pattern, $fullname, $matches)) { | ||||
| return last($matches); | return last($matches); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| private function getGitSvnTrunk() { | |||||
| if (!$this->isGitSvn) { | |||||
| return null; | |||||
| } | |||||
| // See T13293, this depends on the options passed when cloning. | |||||
| // On any error we return `trunk`, which was the previous default. | |||||
asherkin: Re-visiting this after the testing today, I'm not 100% confident this is actually going to… | |||||
Not Done Inline ActionsI'm comfortable waiting for this to explode somewhere, multiple git-svn remotes seems wildly ambitious. epriestley: I'm comfortable waiting for this to explode somewhere, multiple `git-svn` remotes seems wildly… | |||||
| $repository_api = $this->getRepositoryAPI(); | |||||
| list($err, $refspec) = $repository_api->execManualLocal( | |||||
| 'config svn-remote.svn.fetch'); | |||||
| if ($err) { | |||||
| return 'trunk'; | |||||
| } | |||||
| $refspec = rtrim(substr($refspec, strrpos($refspec, ':') + 1)); | |||||
| $prefix = 'refs/remotes/'; | |||||
| if (substr($refspec, 0, strlen($prefix)) !== $prefix) { | |||||
| return 'trunk'; | |||||
| } | |||||
| $refspec = substr($refspec, strlen($prefix)); | |||||
| return $refspec; | |||||
| } | |||||
| private function readEngineArguments() { | private function readEngineArguments() { | ||||
| // NOTE: This is hard-coded for Git right now. | // NOTE: This is hard-coded for Git right now. | ||||
| // TODO: Clean this up and move it into LandEngines. | // TODO: Clean this up and move it into LandEngines. | ||||
| $onto = $this->getEngineOnto(); | $onto = $this->getEngineOnto(); | ||||
| $remote = $this->getEngineRemote(); | $remote = $this->getEngineRemote(); | ||||
| // This just overwrites work we did earlier, but it has to be up in this | // This just overwrites work we did earlier, but it has to be up in this | ||||
| ▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | private function readArguments() { | ||||
| } else if ($this->getArgument('squash')) { | } else if ($this->getArgument('squash')) { | ||||
| $this->useSquash = true; | $this->useSquash = true; | ||||
| } else { | } else { | ||||
| $this->useSquash = !$this->isHistoryImmutable(); | $this->useSquash = !$this->isHistoryImmutable(); | ||||
| } | } | ||||
| $this->ontoRemoteBranch = $this->onto; | $this->ontoRemoteBranch = $this->onto; | ||||
| if ($this->isGitSvn) { | if ($this->isGitSvn) { | ||||
| $this->ontoRemoteBranch = 'trunk'; | $this->ontoRemoteBranch = $this->getGitSvnTrunk(); | ||||
| } else if ($this->isGit) { | } else if ($this->isGit) { | ||||
| $this->ontoRemoteBranch = $this->remote.'/'.$this->onto; | $this->ontoRemoteBranch = $this->remote.'/'.$this->onto; | ||||
| } | } | ||||
| $this->oldBranch = $this->getBranchOrBookmark(); | $this->oldBranch = $this->getBranchOrBookmark(); | ||||
| } | } | ||||
| private function validate() { | private function validate() { | ||||
| ▲ Show 20 Lines • Show All 1,176 Lines • Show Last 20 Lines | |||||
Re-visiting this after the testing today, I'm not 100% confident this is actually going to behave correctly with multiple git-svn remotes or tracking branches, but neither are something I've ever used with it.