1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

Parse Conflicts field in commit message

Summary:
Git adds it automatically.

I don't like this solution much because there could be other unknown fields appended to the end of the commit message which will break parsing.

Test Plan:
Reparsed commit ending with:

> Differential Revision: ...
> Conflicts: ...

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4157
This commit is contained in:
vrana 2012-12-11 16:34:08 -08:00
parent 5cb0f47761
commit 40e3aadc76
3 changed files with 37 additions and 0 deletions

View file

@ -236,6 +236,7 @@ phutil_register_library_map(array(
'DifferentialCommentPreviewController' => 'applications/differential/controller/DifferentialCommentPreviewController.php',
'DifferentialCommentSaveController' => 'applications/differential/controller/DifferentialCommentSaveController.php',
'DifferentialCommitsFieldSpecification' => 'applications/differential/field/specification/DifferentialCommitsFieldSpecification.php',
'DifferentialConflictsFieldSpecification' => 'applications/differential/field/specification/DifferentialConflictsFieldSpecification.php',
'DifferentialController' => 'applications/differential/controller/DifferentialController.php',
'DifferentialDAO' => 'applications/differential/storage/DifferentialDAO.php',
'DifferentialDateCreatedFieldSpecification' => 'applications/differential/field/specification/DifferentialDateCreatedFieldSpecification.php',
@ -1547,6 +1548,7 @@ phutil_register_library_map(array(
'DifferentialCommentPreviewController' => 'DifferentialController',
'DifferentialCommentSaveController' => 'DifferentialController',
'DifferentialCommitsFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialConflictsFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialController' => 'PhabricatorController',
'DifferentialDAO' => 'PhabricatorLiskDAO',
'DifferentialDateCreatedFieldSpecification' => 'DifferentialFieldSpecification',

View file

@ -26,6 +26,7 @@ final class DifferentialDefaultFieldSelector
new DifferentialApplyPatchFieldSpecification(),
new DifferentialRevisionIDFieldSpecification(),
new DifferentialGitSVNIDFieldSpecification(),
new DifferentialConflictsFieldSpecification(),
new DifferentialDateModifiedFieldSpecification(),
new DifferentialDateCreatedFieldSpecification(),
new DifferentialAuditorsFieldSpecification(),

View file

@ -0,0 +1,34 @@
<?php
final class DifferentialConflictsFieldSpecification
extends DifferentialFieldSpecification {
public function shouldAppearOnCommitMessage() {
return true;
}
public function shouldAppearOnCommitMessageTemplate() {
return false;
}
public function getCommitMessageKey() {
return 'conflicts';
}
public function setValueFromParsedCommitMessage($value) {
return $this;
}
public function renderLabelForCommitMessage() {
return 'Conflicts';
}
public function renderValueForCommitMessage($is_edit) {
return null;
}
public function parseValueFromCommitMessage($value) {
return $value;
}
}