1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-23 02:38:48 +02:00
phorge-phorge/src/applications/differential/customfield/DifferentialGitSVNIDField.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
938 B
PHP

<?php
/**
* This field doesn't do anything, it just parses the "git-svn-id" field which
* `git svn` inserts into commit messages so that we don't end up mangling
* some other field.
*/
final class DifferentialGitSVNIDField
extends DifferentialCustomField {
public function getFieldKey() {
return 'differential:git-svn-id';
}
public function getFieldKeyForConduit() {
return 'gitSVNID';
}
public function getFieldName() {
return pht('git-svn-id');
}
public function getFieldDescription() {
return pht(
'Parses the "git-svn-id" field which Git/SVN 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;
}
}