mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-01 09:28:22 +01:00
5afddb6703
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
51 lines
887 B
PHP
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]+';
|
|
}
|
|
|
|
}
|