"'git merge' failed. Your working copy has been left in a partially ".
"merged state. You can: abort with 'git merge --abort'; or follow ".
"the instructions to complete the merge."));
}
} else if ($this->isHg) {
// HG arc land currently doesn't support --merge.
// When merging a bookmark branch to a master branch that
// hasn't changed since the fork, mercurial fails to merge.
// Instead of only working in some cases, we just disable --merge
// until there is a demand for it.
// The user should never reach this line, since --merge is
// forbidden at the command line argument level.
throw new ArcanistUsageException(pht(
"--merge is not currently supported for hg repos."));
}
}
private function push() {
$repository_api = $this->getRepositoryAPI();
// these commands can fail legitimately (e.g. commit hooks)
try {
if ($this->isGit) {
$repository_api->execxLocal(
'commit -F %s',
$this->messageFile);
if (phutil_is_windows()) {
// Occasionally on large repositories on Windows, Git can exit with an unclean working copy here. This prevents reverts from being pushed to the remote when this occurs.
$this->requireCleanWorkingCopy();
}
} else if ($this->isHg) {
// hg rebase produces a commit earlier as part of rebase
if (!$this->useSquash) {
$repository_api->execxLocal(
'commit --logfile %s',
$this->messageFile);
}
}
// We dispatch this event so we can run checks on the merged revision,
// right before it gets pushed out. It's easier to do this in arc land
// than to try to hook into git/hg.
$this->dispatchEvent(
ArcanistEventType::TYPE_LAND_WILLPUSHREVISION,
array());
} catch (Exception $ex) {
$this->executeCleanupAfterFailedPush();
throw $ex;
}
if ($this->getArgument('hold')) {
echo phutil_console_format(pht(
"Holding change in **%s**: it has NOT been pushed yet.",
$this->onto). "\n");
} else {
echo pht('Pushing change...'), "\n\n";
chdir($repository_api->getPath());
if ($this->isGitSvn) {
$err = phutil_passthru('git svn dcommit');
$cmd = "git svn dcommit";
} else if ($this->isGit) {
$err = phutil_passthru(
'git push %s %s',
$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