Page MenuHomestyx hydra

No OneTemporary

diff --git a/resources/sql/autopatches/20200428.inline.01.differential.column.sql b/resources/sql/autopatches/20200428.inline.01.differential.column.sql
new file mode 100644
index 0000000000..d825565000
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.01.differential.column.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
+ ADD attributes LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20200428.inline.02.diffusion.column.sql b/resources/sql/autopatches/20200428.inline.02.diffusion.column.sql
new file mode 100644
index 0000000000..ac567b9a8e
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.02.diffusion.column.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_audit.audit_transaction_comment
+ ADD attributes LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20200428.inline.03.differential.value.sql b/resources/sql/autopatches/20200428.inline.03.differential.value.sql
new file mode 100644
index 0000000000..dfa420a8ac
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.03.differential.value.sql
@@ -0,0 +1,2 @@
+UPDATE {$NAMESPACE}_differential.differential_transaction_comment
+ SET attributes = '{}' WHERE attributes = '';
diff --git a/resources/sql/autopatches/20200428.inline.04.diffusion.value.sql b/resources/sql/autopatches/20200428.inline.04.diffusion.value.sql
new file mode 100644
index 0000000000..3fb10d7f2b
--- /dev/null
+++ b/resources/sql/autopatches/20200428.inline.04.diffusion.value.sql
@@ -0,0 +1,2 @@
+UPDATE {$NAMESPACE}_audit.audit_transaction_comment
+ SET attributes = '{}' WHERE attributes = '';
diff --git a/src/applications/audit/storage/PhabricatorAuditTransactionComment.php b/src/applications/audit/storage/PhabricatorAuditTransactionComment.php
index 64ddca8e25..bc4b1e675b 100644
--- a/src/applications/audit/storage/PhabricatorAuditTransactionComment.php
+++ b/src/applications/audit/storage/PhabricatorAuditTransactionComment.php
@@ -1,70 +1,75 @@
<?php
final class PhabricatorAuditTransactionComment
extends PhabricatorApplicationTransactionComment {
protected $commitPHID;
protected $pathID;
protected $isNewFile = 0;
protected $lineNumber = 0;
protected $lineLength = 0;
protected $fixedState;
protected $hasReplies = 0;
protected $replyToCommentPHID;
protected $legacyCommentID;
+ protected $attributes = array();
private $replyToComment = self::ATTACHABLE;
public function getApplicationTransactionObject() {
return new PhabricatorAuditTransaction();
}
public function shouldUseMarkupCache($field) {
// Only cache submitted comments.
return ($this->getTransactionPHID() != null);
}
protected function getConfiguration() {
$config = parent::getConfiguration();
$config[self::CONFIG_COLUMN_SCHEMA] = array(
'commitPHID' => 'phid?',
'pathID' => 'id?',
'isNewFile' => 'bool',
'lineNumber' => 'uint32',
'lineLength' => 'uint32',
'fixedState' => 'text12?',
'hasReplies' => 'bool',
'replyToCommentPHID' => 'phid?',
'legacyCommentID' => 'id?',
) + $config[self::CONFIG_COLUMN_SCHEMA];
$config[self::CONFIG_KEY_SCHEMA] = array(
'key_path' => array(
'columns' => array('pathID'),
),
'key_draft' => array(
'columns' => array('authorPHID', 'transactionPHID'),
),
'key_commit' => array(
'columns' => array('commitPHID'),
),
'key_legacy' => array(
'columns' => array('legacyCommentID'),
),
) + $config[self::CONFIG_KEY_SCHEMA];
+ $config[self::CONFIG_SERIALIZATION] = array(
+ 'attributes' => self::SERIALIZATION_JSON,
+ ) + idx($config, self::CONFIG_SERIALIZATION, array());
+
return $config;
}
public function attachReplyToComment(
PhabricatorAuditTransactionComment $comment = null) {
$this->replyToComment = $comment;
return $this;
}
public function getReplyToComment() {
return $this->assertAttached($this->replyToComment);
}
}
diff --git a/src/applications/differential/storage/DifferentialTransactionComment.php b/src/applications/differential/storage/DifferentialTransactionComment.php
index d2ec6acc43..b2c24c340c 100644
--- a/src/applications/differential/storage/DifferentialTransactionComment.php
+++ b/src/applications/differential/storage/DifferentialTransactionComment.php
@@ -1,113 +1,121 @@
<?php
final class DifferentialTransactionComment
extends PhabricatorApplicationTransactionComment {
protected $revisionPHID;
protected $changesetID;
protected $isNewFile = 0;
protected $lineNumber = 0;
protected $lineLength = 0;
protected $fixedState;
protected $hasReplies = 0;
protected $replyToCommentPHID;
+ protected $attributes = array();
private $replyToComment = self::ATTACHABLE;
private $isHidden = self::ATTACHABLE;
private $changeset = self::ATTACHABLE;
public function getApplicationTransactionObject() {
return new DifferentialTransaction();
}
public function attachReplyToComment(
DifferentialTransactionComment $comment = null) {
$this->replyToComment = $comment;
return $this;
}
public function getReplyToComment() {
return $this->assertAttached($this->replyToComment);
}
protected function getConfiguration() {
$config = parent::getConfiguration();
+
$config[self::CONFIG_COLUMN_SCHEMA] = array(
'revisionPHID' => 'phid?',
'changesetID' => 'id?',
'isNewFile' => 'bool',
'lineNumber' => 'uint32',
'lineLength' => 'uint32',
'fixedState' => 'text12?',
'hasReplies' => 'bool',
'replyToCommentPHID' => 'phid?',
) + $config[self::CONFIG_COLUMN_SCHEMA];
+
$config[self::CONFIG_KEY_SCHEMA] = array(
'key_draft' => array(
'columns' => array('authorPHID', 'transactionPHID'),
),
'key_changeset' => array(
'columns' => array('changesetID'),
),
'key_revision' => array(
'columns' => array('revisionPHID'),
),
) + $config[self::CONFIG_KEY_SCHEMA];
+
+ $config[self::CONFIG_SERIALIZATION] = array(
+ 'attributes' => self::SERIALIZATION_JSON,
+ ) + idx($config, self::CONFIG_SERIALIZATION, array());
+
return $config;
}
public function shouldUseMarkupCache($field) {
// Only cache submitted comments.
return ($this->getTransactionPHID() != null);
}
public static function sortAndGroupInlines(
array $inlines,
array $changesets) {
assert_instances_of($inlines, 'DifferentialTransaction');
assert_instances_of($changesets, 'DifferentialChangeset');
$changesets = mpull($changesets, null, 'getID');
$changesets = msort($changesets, 'getFilename');
// Group the changesets by file and reorder them by display order.
$inline_groups = array();
foreach ($inlines as $inline) {
$changeset_id = $inline->getComment()->getChangesetID();
$inline_groups[$changeset_id][] = $inline;
}
$inline_groups = array_select_keys($inline_groups, array_keys($changesets));
foreach ($inline_groups as $changeset_id => $group) {
// Sort the group of inlines by line number.
$items = array();
foreach ($group as $inline) {
$comment = $inline->getComment();
$num = $comment->getLineNumber();
$len = $comment->getLineLength();
$id = $comment->getID();
$items[] = array(
'inline' => $inline,
'sort' => sprintf('~%010d%010d%010d', $num, $len, $id),
);
}
$items = isort($items, 'sort');
$items = ipull($items, 'inline');
$inline_groups[$changeset_id] = $items;
}
return $inline_groups;
}
public function getIsHidden() {
return $this->assertAttached($this->isHidden);
}
public function attachIsHidden($hidden) {
$this->isHidden = $hidden;
return $this;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Apr 28, 3:29 AM (14 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
107725
Default Alt Text
(7 KB)

Event Timeline