Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
Show First 20 Lines • Show All 581 Lines • ▼ Show 20 Lines | if ($this->shouldOnlyCreateDiff()) { | ||||
echo pht('Updated an existing Differential revision:')."\n"; | echo pht('Updated an existing Differential revision:')."\n"; | ||||
} else { | } else { | ||||
$revision = $this->dispatchWillCreateRevisionEvent($revision); | $revision = $this->dispatchWillCreateRevisionEvent($revision); | ||||
$result = $conduit->callMethodSynchronous( | $result = $conduit->callMethodSynchronous( | ||||
'differential.createrevision', | 'differential.createrevision', | ||||
$revision); | $revision); | ||||
if ($this->shouldAmend()) { | |||||
$repository_api = $this->getRepositoryAPI(); | |||||
if ($repository_api->supportsAmend()) { | |||||
echo pht('Updating commit message...')."\n"; | |||||
$revised_message = $conduit->callMethodSynchronous( | $revised_message = $conduit->callMethodSynchronous( | ||||
'differential.getcommitmessage', | 'differential.getcommitmessage', | ||||
array( | array( | ||||
'revision_id' => $result['revisionid'], | 'revision_id' => $result['revisionid'], | ||||
)); | )); | ||||
if ($this->shouldAmend()) { | |||||
$repository_api = $this->getRepositoryAPI(); | |||||
if ($repository_api->supportsAmend()) { | |||||
echo pht('Updating commit message...')."\n"; | |||||
$repository_api->amendCommit($revised_message); | $repository_api->amendCommit($revised_message); | ||||
// The above updates the commit object; update the record on | |||||
// the diff. | |||||
$this->updateLocalDiffProperty(); | |||||
} else { | } else { | ||||
echo pht( | echo pht( | ||||
'Commit message was not amended. Amending commit message is '. | 'Commit message was not amended. Amending commit message is '. | ||||
'only supported in git and hg (version 2.2 or newer)'); | 'only supported in git and hg (version 2.2 or newer)'); | ||||
} | } | ||||
} | } | ||||
echo pht('Created a new Differential revision:')."\n"; | echo pht('Created a new Differential revision:')."\n"; | ||||
▲ Show 20 Lines • Show All 2,301 Lines • Show Last 20 Lines |