Changeset View
Changeset View
Standalone View
Standalone View
src/land/ArcanistGitLandEngine.php
Show All 39 Lines | public function parseArguments() { | ||||
if ($is_perforce) { | if ($is_perforce) { | ||||
$this->setIsGitPerforce(true); | $this->setIsGitPerforce(true); | ||||
$this->writeWarn( | $this->writeWarn( | ||||
pht('P4 MODE'), | pht('P4 MODE'), | ||||
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); | ||||
} | } | ||||
public function execute() { | public function execute() { | ||||
$this->verifySourceAndTargetExist(); | $this->verifySourceAndTargetExist(); | ||||
$this->fetchTarget(); | $this->fetchTarget(); | ||||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | if ($this->getIsGitPerforce()) { | ||||
// Detect moves and submit them to Perforce as move operations. | // Detect moves and submit them to Perforce as move operations. | ||||
$flags_argv[] = '-M'; | $flags_argv[] = '-M'; | ||||
// If we run into a conflict, abort the operation. We expect users to | // If we run into a conflict, abort the operation. We expect users to | ||||
// fix conflicts and run "arc land" again. | // fix conflicts and run "arc land" again. | ||||
$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); | ||||
if ($err) { | if ($err) { | ||||
throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
pht( | pht( | ||||
'Submit failed! Fix the error and run "arc land" again.')); | 'Submit failed! Fix the error and run "arc land" again.')); | ||||
▲ Show 20 Lines • Show All 560 Lines • Show Last 20 Lines |