diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php --- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php +++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php @@ -117,18 +117,30 @@ // reverts itself. unset($reverted_commit_phids[$commit->getPHID()]); - $editor = new PhabricatorEdgeEditor(); - foreach ($reverted_commit_phids as $commit_phid) { - try { - $editor->addEdge( - $commit->getPHID(), - DiffusionCommitRevertsCommitEdgeType::EDGECONST, - $commit_phid); - } catch (PhabricatorEdgeCycleException $ex) { - continue; - } + $xactions = array(); + $reverts_edge = DiffusionCommitRevertsCommitEdgeType::EDGECONST; + + $xactions[] = id(new PhabricatorAuditTransaction()) + ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) + ->setMetadataValue('edge:type', $reverts_edge) + ->setNewValue(array('+' => array_fuse($reverted_commit_phids))); + + $content_source = PhabricatorContentSource::newForSource( + PhabricatorContentSource::SOURCE_DAEMON, + array()); + + try { + $commit->attachRepository($repository); + $editor = id(new PhabricatorAuditEditor()) + ->setActor($actor) + ->setActingAsPHID($acting_as_phid) + ->setContinueOnMissingFields(true) + ->setContinueOnNoEffect(true) + ->setContentSource($content_source) + ->applyTransactions($commit, $xactions); + } catch (PhabricatorEdgeCycleException $ex) { + // Ignore it. } - $editor->save(); } // NOTE: The `differential_commit` table has a unique ID on `commitPHID`,