3 final class DifferentialTitleCommitMessageField
4 extends DifferentialCommitMessageField
{
6 const FIELDKEY
= 'title';
8 public function getFieldName() {
12 public function getFieldOrder() {
16 public static function getDefaultTitle() {
17 return pht('<<Replace this line with your revision title>');
20 public function parseFieldValue($value) {
21 if ($value === self
::getDefaultTitle()) {
22 $this->raiseParseException(
24 'Replace the default title line with a human-readable revision '.
25 'title which describes the changes you are making.'));
28 return parent
::parseFieldValue($value);
31 public function validateFieldValue($value) {
32 if (!strlen($value)) {
33 $this->raiseValidationException(
35 'You must provide a revision title in the first line '.
36 'of your commit message.'));
40 public function readFieldValueFromObject(DifferentialRevision
$revision) {
41 $value = $revision->getTitle();
43 if (!strlen($value)) {
44 return self
::getDefaultTitle();
50 public function getFieldTransactions($value) {
53 'type' => DifferentialRevisionTitleTransaction
::EDITKEY
,