@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 PhabricatorAuditSynchronizeManagementWorkflow
4 extends PhabricatorAuditManagementWorkflow {
5
6 protected function didConstruct() {
7 $this
8 ->setName('synchronize')
9 ->setExamples(
10 "**synchronize** __repository__ ...\n".
11 "**synchronize** __commit__ ...\n".
12 "**synchronize** --all")
13 ->setSynopsis(
14 pht(
15 'Update commits to make their summary audit state reflect the '.
16 'state of their actual audit requests. This can fix inconsistencies '.
17 'in database state if audit requests have been mangled '.
18 'accidentally (or on purpose).'))
19 ->setArguments(
20 array_merge(
21 $this->getCommitConstraintArguments(),
22 array()));
23 }
24
25 public function execute(PhutilArgumentParser $args) {
26 $viewer = $this->getViewer();
27 $objects = $this->loadCommitsWithConstraints($args);
28
29 foreach ($objects as $object) {
30 $commits = $this->loadCommitsForConstraintObject($object);
31 foreach ($commits as $commit) {
32 $this->synchronizeCommitAuditState($commit->getPHID());
33 }
34 }
35 }
36
37}