1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-01 09:28:22 +01:00
phorge-phorge/src/applications/differential/field/parser/DifferentialCustomFieldRevertsParser.php
epriestley 5afddb6703 Bring "Reverts X" to more general infrastructure and port unit tests
Summary:
Ref T3886. See D8261. This brings the "reverts x" phrase to modern infrastructure. It isn't actually called by the real parser yet, I'm going to do that in one go at the end so I can test everything more easily.

This had unit tests; port most of them forward.

Test Plan: Added and executed unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3886

Differential Revision: https://secure.phabricator.com/D8262
2014-02-17 15:58:59 -08:00

51 lines
887 B
PHP

<?php
final class DifferentialCustomFieldRevertsParser
extends PhabricatorCustomFieldMonogramParser {
protected function getPrefixes() {
// NOTE: Git language is "This reverts commit X."
// NOTE: Mercurial language is "Backed out changeset Y".
return array(
'revert',
'reverts',
'reverted',
'backout',
'backsout',
'backedout',
'back out',
'backs out',
'backed out',
'undo',
'undoes',
);
}
protected function getInfixes() {
return array(
'commit',
'commits',
'change',
'changes',
'changeset',
'changesets',
'rev',
'revs',
'revision',
'revisions',
'diff',
'diffs',
);
}
protected function getSuffixes() {
return array();
}
protected function getMonogramPattern() {
return '[rA-Z0-9a-f]+';
}
}