Page MenuHomePhabricator

D11212.id26928.diff
No OneTemporary

D11212.id26928.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,34 @@
// 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)))
+ ->attachComment(
+ id(new PhabricatorAuditTransactionComment())
+ ->setCommitPHID($commit->getPHID())
+ ->setContent($message));
+
+ $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`,

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 22, 5:10 AM (2 w, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705517
Default Alt Text
D11212.id26928.diff (2 KB)

Event Timeline