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
private $isGit;
private $isGitSvn;
private $isHg;
+ private $isHgSvn;
private $oldBranch;
private $branch;
$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();
$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";