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; | |||||
} | |||||
$repository_api = $this->getRepositoryAPI(); | |||||
list($err, $refspec) = $repository_api->execManualLocal( | |||||
'config svn-remote.svn.fetch'); | |||||
asherkin: Re-visiting this after the testing today, I'm not 100% confident this is actually going to… | |||||
epriestleyUnsubmitted 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… | |||||
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,002 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.