Page MenuHomePhabricator

D19681.diff
No OneTemporary

D19681.diff

diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php
--- a/src/workflow/ArcanistLandWorkflow.php
+++ b/src/workflow/ArcanistLandWorkflow.php
@@ -310,6 +310,33 @@
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.
+
+ $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() {
// NOTE: This is hard-coded for Git right now.
// TODO: Clean this up and move it into LandEngines.
@@ -494,7 +521,7 @@
$this->ontoRemoteBranch = $this->onto;
if ($this->isGitSvn) {
- $this->ontoRemoteBranch = 'trunk';
+ $this->ontoRemoteBranch = $this->getGitSvnTrunk();
} else if ($this->isGit) {
$this->ontoRemoteBranch = $this->remote.'/'.$this->onto;
}

File Metadata

Mime Type
text/plain
Expires
Tue, May 14, 12:25 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6294460
Default Alt Text
D19681.diff (1 KB)

Event Timeline