1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-16 03:42:41 +01:00
phorge-phorge/src/applications/differential/customfield/DifferentialConflictsField.php
epriestley ae3c1f7819 Perform commit message parsing and construction with new CustomFields
Summary: Ref T2222. Ref T3886. Converts parsing and construction of commit messages to be driven by CustomField.

Test Plan:
This is a huge, messy change. I've made an effort to test it exhasutively, but suspect I probably missed a few behaviors. Roughly:

  - Enumerted all current fields (fields implementing `shouldAppearOnCommitMessage()`) and tried to test them one by one.
  - Used `arc diff --edit` repeatedly to manipulate each field (this workflow hits both the parse and construct steps).
  - Used `arc amend --show` to examine construct output (this does not activate the "edit" mode).

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3886, T2222

Differential Revision: https://secure.phabricator.com/D8449
2014-03-11 13:01:55 -07:00

45 lines
933 B
PHP

<?php
/**
* This field doesn't do anything, it just parses the "Conflicts:" field which
* `git` can insert after a merge, so we don't squish the field value into
* some other field.
*/
final class DifferentialConflictsField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:conflicts';
}
public function getFieldKeyForConduit() {
return 'conflicts';
}
public function getFieldName() {
return pht('Conflicts');
}
public function getFieldDescription() {
return pht(
'Parses the "Conflicts" field which Git can inject into commit '.
'messages.');
}
public function canDisableField() {
return false;
}
public function shouldAppearInCommitMessage() {
return true;
}
public function shouldAllowEditInCommitMessage() {
return false;
}
public function renderCommitMessageValue(array $handles) {
return null;
}
}