Page MenuHomePhabricator

D11212.id26918.diff
No OneTemporary

D11212.id26918.diff

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,31 @@
// 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();
+
+ $xactions[] = id(new PhabricatorAuditTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
+ ->setMetadataValue('edge:type', DiffusionCommitRevertsCommitEdgeType::EDGECONST)
+ ->setNewValue(array('+' => array_fuse($reverted_commit_phids)))
+ ->attachComment(
+ id(new PhabricatorAuditTransactionComment())
+ ->setCommitPHID($commit->getPHID())
+ ->setContent($message));
+
+ $content_source = PhabricatorContentSource::newForSource(
+ PhabricatorContentSource::SOURCE_DAEMON,
+ array());
+
+ try {
+ $editor = id(new PhabricatorAuditEditor())
+ ->setActor($actor)
+ ->setActingAsPHID($acting_as_phid)
+ ->setContinueOnMissingFields(true)
+ ->setContentSource($content_source)
+ ->applyTransactions($commit, $xactions);
+ } catch (PhabricatorApplicationTransactionNoEffectException $ex) {
+ //
}
- $editor->save();
}
// NOTE: The `differential_commit` table has a unique ID on `commitPHID`,

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 6:43 AM (6 d, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6765921
Default Alt Text
D11212.id26918.diff (1 KB)

Event Timeline