@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DiffusionPreCommitRefChangeHeraldField
4 extends DiffusionPreCommitRefHeraldField {
5
6 const FIELDCONST = 'diffusion.pre.ref.change';
7
8 public function getHeraldFieldName() {
9 return pht('Ref change type');
10 }
11
12 public function getHeraldFieldValue($object) {
13 return $object->getChangeFlags();
14 }
15
16 public function getHeraldFieldConditions() {
17 return array(
18 HeraldAdapter::CONDITION_HAS_BIT,
19 HeraldAdapter::CONDITION_NOT_BIT,
20 );
21 }
22
23 public function getHeraldFieldValueType($condition) {
24 return id(new HeraldSelectFieldValue())
25 ->setKey(self::FIELDCONST)
26 ->setOptions(
27 PhabricatorRepositoryPushLog::getHeraldChangeFlagConditionOptions())
28 ->setDefault(PhabricatorRepositoryPushLog::CHANGEFLAG_ADD);
29 }
30
31}