Commit 73943d1b authored by epriestley's avatar epriestley

Make "arc land --merge" an explicit error when targeting a Perforce remote

Summary: Ref T13434. Since "git p4 submit" gets more complicated when submitting merges, and empty merges (as with "--no-ff") seem to vanish, and it's not clear this is desirable or useful anyway, just make the "merge" strategy an explicit error with Perforce remotes.

Test Plan: Ran "arc land --merge ..." in a Git/Perforce repository, got an explicit error. Ran "arc land --squash ...", got existing working behavior.

Maniphest Tasks: T13434

Differential Revision: https://secure.phabricator.com/D20871
parent 7383c2f4
......@@ -45,6 +45,14 @@ final class ArcanistGitLandEngine
pht(
'Operating in Git/Perforce mode after selecting a Perforce '.
'remote.'));
if (!$this->getShouldSquash()) {
throw new PhutilArgumentUsageException(
pht(
'Perforce mode does not support the "merge" land strategy. '.
'Use the "squash" land strategy when landing to a Perforce '.
'remote (you can use "--squash" to select this strategy).'));
}
}
$this->setTargetRemote($remote);
......@@ -334,7 +342,7 @@ final class ArcanistGitLandEngine
$flags_argv[] = '--conflict=quit';
$err = $api->execPassthru(
'%LR p4 submit %LR --commit %s --',
'%LR p4 submit %LR --commit %R --',
$config_argv,
$flags_argv,
$this->mergedRef);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment