Revert "Make DifferentialChangesetParser explicitly map display to storage for comments"

This reverts commit a0af5b6643.
This commit is contained in:
tuomaspelkonen
2011-05-06 18:32:28 -07:00
parent 1ed915aef2
commit 1c2222f26f
2 changed files with 26 additions and 137 deletions

View File

@@ -154,12 +154,8 @@ class DifferentialChangesetViewController extends DifferentialController {
$parser->setLeftSideCommentMapping($left_source, $left_new);
$parser->setWhitespaceMode($request->getStr('whitespace'));
// Load both left-side and right-side inline comments.
$inlines = $this->loadInlineComments(
array($left_source, $right_source),
$author_phid);
$phids = array();
$inlines = $this->loadInlineComments($id, $author_phid);
foreach ($inlines as $inline) {
$parser->parseInlineComment($inline);
$phids[$inline->getAuthorPHID()] = true;
@@ -232,15 +228,10 @@ class DifferentialChangesetViewController extends DifferentialController {
));
}
private function loadInlineComments(array $changeset_ids, $author_phid) {
$changeset_ids = array_unique(array_filter($changeset_ids));
if (!$changeset_ids) {
return;
}
private function loadInlineComments($changeset_id, $author_phid) {
return id(new DifferentialInlineComment())->loadAllWhere(
'changesetID IN (%Ld) AND (commentID IS NOT NULL OR authorPHID = %s)',
$changeset_ids,
'changesetID = %d AND (commentID IS NOT NULL OR authorPHID = %s)',
$changeset_id,
$author_phid);
}