Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
Show First 20 Lines • Show All 1,956 Lines • ▼ Show 20 Lines | private function parseCommitMessagesIntoFields(array $local) { | ||||
$faux_message = array(); | $faux_message = array(); | ||||
if ($this->getArgument('reviewers')) { | if ($this->getArgument('reviewers')) { | ||||
$faux_message[] = pht('Reviewers: %s', $this->getArgument('reviewers')); | $faux_message[] = pht('Reviewers: %s', $this->getArgument('reviewers')); | ||||
} | } | ||||
if ($this->getArgument('cc')) { | if ($this->getArgument('cc')) { | ||||
$faux_message[] = pht('CC: %s', $this->getArgument('cc')); | $faux_message[] = pht('CC: %s', $this->getArgument('cc')); | ||||
} | } | ||||
// See T12069. After T10312, the first line of a message is always parsed | |||||
// as a title. Add a placeholder so "Reviewers" and "CC" are never the | |||||
// first line. | |||||
$placeholder_title = pht('<placeholder>'); | |||||
if ($faux_message) { | if ($faux_message) { | ||||
array_unshift($faux_message, $placeholder_title); | |||||
$faux_message = implode("\n\n", $faux_message); | $faux_message = implode("\n\n", $faux_message); | ||||
$local = array( | $local = array( | ||||
'(Flags) ' => array( | '(Flags) ' => array( | ||||
'message' => $faux_message, | 'message' => $faux_message, | ||||
'summary' => pht('Command-Line Flags'), | 'summary' => pht('Command-Line Flags'), | ||||
), | ), | ||||
) + $local; | ) + $local; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | private function parseCommitMessagesIntoFields(array $local) { | ||||
$fields = array_reverse($fields); | $fields = array_reverse($fields); | ||||
foreach ($fields as $hash => $dict) { | foreach ($fields as $hash => $dict) { | ||||
$title = idx($dict, 'title'); | $title = idx($dict, 'title'); | ||||
if (!strlen($title)) { | if (!strlen($title)) { | ||||
continue; | continue; | ||||
} | } | ||||
if ($title === $placeholder_title) { | |||||
continue; | |||||
} | |||||
if (!isset($result['title'])) { | if (!isset($result['title'])) { | ||||
// We don't have a title yet, so use this one. | // We don't have a title yet, so use this one. | ||||
$result['title'] = $title; | $result['title'] = $title; | ||||
} else { | } else { | ||||
// We already have a title, so merge this new title into the summary. | // We already have a title, so merge this new title into the summary. | ||||
$summary = idx($dict, 'summary'); | $summary = idx($dict, 'summary'); | ||||
if ($summary) { | if ($summary) { | ||||
$summary = $title."\n\n".$summary; | $summary = $title."\n\n".$summary; | ||||
▲ Show 20 Lines • Show All 865 Lines • Show Last 20 Lines |