1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 10:12:41 +01:00

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
This commit is contained in:
epriestley 2019-10-28 11:50:08 -07:00
parent 7383c2f4e6
commit 73943d1bc9

View file

@ -45,6 +45,14 @@ final class ArcanistGitLandEngine
pht( pht(
'Operating in Git/Perforce mode after selecting a Perforce '. 'Operating in Git/Perforce mode after selecting a Perforce '.
'remote.')); '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); $this->setTargetRemote($remote);
@ -334,7 +342,7 @@ final class ArcanistGitLandEngine
$flags_argv[] = '--conflict=quit'; $flags_argv[] = '--conflict=quit';
$err = $api->execPassthru( $err = $api->execPassthru(
'%LR p4 submit %LR --commit %s --', '%LR p4 submit %LR --commit %R --',
$config_argv, $config_argv,
$flags_argv, $flags_argv,
$this->mergedRef); $this->mergedRef);