1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 08:42:40 +01:00

Allow running arc land after git svn rebase

Summary: `git pull` may fail in git-svn after rebasing (which is a side effect of dcommit).

Test Plan:
  $ git svn rebase
  $ git log trunk..master
  $ git pull --ff-only; echo $?

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4716
This commit is contained in:
vrana 2013-01-28 15:54:37 -08:00
parent 410b58a2e2
commit 0586b12d2f

View file

@ -384,17 +384,23 @@ EOTEXT
$local_ahead_of_remote = false; $local_ahead_of_remote = false;
if ($this->isGit) { if ($this->isGit) {
$repository_api->execxLocal('pull --ff-only'); try {
$repository_api->execxLocal('pull --ff-only');
if (!$this->isGitSvn) { } catch (CommandException $ex) {
if (!$this->isGitSvn) {
throw $ex;
}
list($out) = $repository_api->execxLocal( list($out) = $repository_api->execxLocal(
'log %s..%s', 'log %s..%s',
$this->ontoRemoteBranch, $this->ontoRemoteBranch,
$this->onto); $this->onto);
if (strlen(trim($out))) { if (strlen(trim($out))) {
$local_ahead_of_remote = true; $local_ahead_of_remote = true;
} else {
$repository_api->execxLocal('svn rebase');
} }
} }
} else if ($this->isHg) { } else if ($this->isHg) {
// execManual instead of execx because outgoing returns // execManual instead of execx because outgoing returns
// code 1 when there is nothing outgoing // code 1 when there is nothing outgoing