mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-10 08:52:39 +01:00
Fix hg arc land on hg-svn repos
Summary: arc land on a hg-svn repository would fail because arc land uses 'hg push -r' to specify which revs to push which is not supported by hg-svn. Now we just use 'hg push' which, when used against svn, only pushes the current branch (which happens to be the branch we're trying to land). We can't use standard 'hg push' for non-svn repos though because when used against a vanilla hg repo 'hg push' pushes all branches. Also remove --new-branch from 'hg push' because it's extremely unlikely that a person wants to create a new branch on the server via arc land. Test Plan: Ran arc land on a normal hg repo, verified it used 'hg push -r'. Ran arc land on a hg-svn repo, verified it used 'hg push' and it pushed the correct changes. Reviewers: epriestley, sid0, dschleimer Reviewed By: epriestley CC: bos, aran, Korvin Maniphest Tasks: T2403 Differential Revision: https://secure.phabricator.com/D4653
This commit is contained in:
parent
93ebde0d12
commit
c8efb41811
1 changed files with 15 additions and 1 deletions
|
@ -9,6 +9,7 @@ final class ArcanistLandWorkflow extends ArcanistBaseWorkflow {
|
|||
private $isGit;
|
||||
private $isGitSvn;
|
||||
private $isHg;
|
||||
private $isHgSvn;
|
||||
|
||||
private $oldBranch;
|
||||
private $branch;
|
||||
|
@ -185,6 +186,11 @@ EOTEXT
|
|||
$this->isGitSvn = (idx($repository, 'vcs') == 'svn');
|
||||
}
|
||||
|
||||
if ($this->isHg) {
|
||||
list ($err) = $repository_api->execManualLocal('svn info');
|
||||
$this->isHgSvn = !$err;
|
||||
}
|
||||
|
||||
$branch = $this->getArgument('branch');
|
||||
if (empty($branch)) {
|
||||
$branch = $this->getBranchOrBookmark();
|
||||
|
@ -732,9 +738,17 @@ EOTEXT
|
|||
$this->remote,
|
||||
$this->onto);
|
||||
$cmd = "git push";
|
||||
} else if ($this->isHgSvn) {
|
||||
// hg-svn doesn't support 'push -r', so we do a normal push
|
||||
// which hg-svn modifies to only push the current branch and
|
||||
// ancestors.
|
||||
$err = $repository_api->execPassthru(
|
||||
'push %s',
|
||||
$this->remote);
|
||||
$cmd = "hg push";
|
||||
} else if ($this->isHg) {
|
||||
$err = $repository_api->execPassthru(
|
||||
'push --new-branch -r %s %s',
|
||||
'push -r %s %s',
|
||||
$this->onto,
|
||||
$this->remote);
|
||||
$cmd = "hg push";
|
||||
|
|
Loading…
Reference in a new issue