mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-21 19:19:12 +01:00
Yell at developers if they don't replace the default revision title with thier new revision title.
Summary: Same as the title Test Plan: Will test locally by running arc diff Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, AnhNhan, starruler Maniphest Tasks: T2663 Differential Revision: https://secure.phabricator.com/D5297
This commit is contained in:
parent
7487c57401
commit
05c5c43159
2 changed files with 16 additions and 2 deletions
|
@ -102,7 +102,8 @@ final class ConduitAPI_differential_getcommitmessage_Method
|
||||||
$label = $field->renderLabelForCommitMessage();
|
$label = $field->renderLabelForCommitMessage();
|
||||||
if (!strlen($value)) {
|
if (!strlen($value)) {
|
||||||
if ($field_key === 'title') {
|
if ($field_key === 'title') {
|
||||||
$commit_message[] = '<<Enter Revision Title>>';
|
$commit_message[] =
|
||||||
|
DifferentialTitleFieldSpecification::getDefaultRevisionTitle();
|
||||||
} else {
|
} else {
|
||||||
if ($field->shouldAppearOnCommitMessageTemplate() && $is_edit) {
|
if ($field->shouldAppearOnCommitMessageTemplate() && $is_edit) {
|
||||||
$commit_message[] = $label.': ';
|
$commit_message[] = $label.': ';
|
||||||
|
|
|
@ -41,7 +41,16 @@ final class DifferentialTitleFieldSpecification
|
||||||
if (!strlen($this->title)) {
|
if (!strlen($this->title)) {
|
||||||
$this->error = 'Required';
|
$this->error = 'Required';
|
||||||
throw new DifferentialFieldValidationException(
|
throw new DifferentialFieldValidationException(
|
||||||
"You must provide a title.");
|
"You must provide a revision title in the first line ".
|
||||||
|
"of your commit message.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('/^<<.*>>$/', $this->title)) {
|
||||||
|
$default_title = self::getDefaultRevisionTitle();
|
||||||
|
$this->error = 'Required';
|
||||||
|
throw new DifferentialFieldValidationException(
|
||||||
|
"Replace the line '{$default_title}' with a revision title ".
|
||||||
|
"that describes the change.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +95,10 @@ final class DifferentialTitleFieldSpecification
|
||||||
return 'wide pri';
|
return 'wide pri';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getDefaultRevisionTitle() {
|
||||||
|
return '<<Replace this line with your Revision Title>>';
|
||||||
|
}
|
||||||
|
|
||||||
public function renderValueForRevisionList(DifferentialRevision $revision) {
|
public function renderValueForRevisionList(DifferentialRevision $revision) {
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
|
|
Loading…
Add table
Reference in a new issue