diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 2e5ad39f62..1172834db3 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,9 +9,9 @@ return array( 'names' => array( 'conpherence.pkg.css' => '3c8a0668', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => 'c69171e6', + 'core.pkg.css' => '6a8c9533', 'core.pkg.js' => '6e5c894f', - 'differential.pkg.css' => 'eef74643', + 'differential.pkg.css' => 'ce54994e', 'differential.pkg.js' => '49515551', 'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.js' => 'a98c0bf7', @@ -61,7 +61,7 @@ return array( 'rsrc/css/application/dashboard/dashboard.css' => '5a205b9d', 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 'rsrc/css/application/differential/add-comment.css' => '7e5900d9', - 'rsrc/css/application/differential/changeset-view.css' => '215129ef', + 'rsrc/css/application/differential/changeset-view.css' => 'db306b82', 'rsrc/css/application/differential/core.css' => '7300a73e', 'rsrc/css/application/differential/phui-inline-comment.css' => '48acce5b', 'rsrc/css/application/differential/revision-comment.css' => '7dbc8d1d', @@ -169,7 +169,7 @@ return array( 'rsrc/css/phui/phui-pager.css' => 'd022c7ad', 'rsrc/css/phui/phui-pinboard-view.css' => '1f08f5d8', 'rsrc/css/phui/phui-policy-section-view.css' => '139fdc64', - 'rsrc/css/phui/phui-property-list-view.css' => 'cad62236', + 'rsrc/css/phui/phui-property-list-view.css' => '34180764', 'rsrc/css/phui/phui-remarkup-preview.css' => '91767007', 'rsrc/css/phui/phui-segment-bar-view.css' => '5166b370', 'rsrc/css/phui/phui-spacing.css' => 'b05cadc3', @@ -554,7 +554,7 @@ return array( 'conpherence-thread-manager' => 'aec8e38c', 'conpherence-transaction-css' => '3a3f5e7e', 'd3' => '9d068042', - 'differential-changeset-view-css' => '215129ef', + 'differential-changeset-view-css' => 'db306b82', 'differential-core-view-css' => '7300a73e', 'differential-revision-add-comment-css' => '7e5900d9', 'differential-revision-comment-css' => '7dbc8d1d', @@ -865,7 +865,7 @@ return array( 'phui-pager-css' => 'd022c7ad', 'phui-pinboard-view-css' => '1f08f5d8', 'phui-policy-section-view-css' => '139fdc64', - 'phui-property-list-view-css' => 'cad62236', + 'phui-property-list-view-css' => '34180764', 'phui-remarkup-preview-css' => '91767007', 'phui-segment-bar-view-css' => '5166b370', 'phui-spacing-css' => 'b05cadc3', @@ -1065,9 +1065,6 @@ return array( 'javelin-behavior', 'javelin-request', ), - '215129ef' => array( - 'phui-inline-comment-view-css', - ), '225bbb98' => array( 'javelin-install', 'javelin-reactor', @@ -2072,6 +2069,9 @@ return array( 'javelin-uri', 'phabricator-notification', ), + 'db306b82' => array( + 'phui-inline-comment-view-css', + ), 'dfa1d313' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php index 9492b6901a..408988ed1f 100644 --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -1693,7 +1693,7 @@ final class DifferentialChangesetParser extends Phobject { $new_data = ipull($new_data, 'text'); $new_data = implode('', $new_data); - $new_ref->setData($old_data); + $new_ref->setData($new_data); } $old_engines = PhabricatorDocumentEngine::getEnginesForRef( diff --git a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php index 1b7c75b082..e628a5a2f8 100644 --- a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php @@ -241,7 +241,7 @@ final class DifferentialChangesetOneUpRenderer $primitives[] = array( 'type' => 'old-file', 'htype' => '', - 'line' => 1, + 'line' => $block->getBlockKey(), 'render' => $block->newContentView(), ); } diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php index 160bdbbb90..63961c7983 100644 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -369,94 +369,120 @@ final class DifferentialChangesetTwoUpRenderer $old_changeset_key, $new_changeset_key) { - $old_view = null; - $new_view = null; + $old_comments = $this->getOldComments(); + $new_comments = $this->getNewComments(); + $rows = array(); foreach ($block_list->newTwoUpLayout() as $row) { list($old, $new) = $row; if ($old) { - $old_view = $old->newContentView(); + $old_content = $old->newContentView(); + $old_key = $old->getBlockKey(); + $old_classes = implode(' ', $old->getClasses()); } else { - $old_view = null; + $old_content = null; + $old_key = null; + $old_classes = null; } if ($new) { - $new_view = $new->newContentView(); + $new_content = $new->newContentView(); + $new_key = $new->getBlockKey(); + $new_classes = implode(' ', $new->getClasses()); } else { - $new_view = null; + $new_content = null; + $new_key = null; + $new_classes = null; } - } - $html_old = array(); - $html_new = array(); - foreach ($this->getOldComments() as $on_line => $comment_group) { - foreach ($comment_group as $comment) { - $inline = $this->buildInlineComment( - $comment, - $on_right = false); - $html_old[] = $this->getRowScaffoldForInline($inline); + $old_inline_rows = array(); + if ($old_key !== null) { + $old_inlines = idx($old_comments, $old_key, array()); + foreach ($old_inlines as $inline) { + $inline = $this->buildInlineComment( + $inline, + $on_right = false); + $old_inline_rows[] = $this->getRowScaffoldForInline($inline); + } } - } - foreach ($this->getNewComments() as $lin_line => $comment_group) { - foreach ($comment_group as $comment) { - $inline = $this->buildInlineComment( - $comment, - $on_right = true); - $html_new[] = $this->getRowScaffoldForInline($inline); + + $new_inline_rows = array(); + if ($new_key !== null) { + $new_inlines = idx($new_comments, $new_key, array()); + foreach ($new_inlines as $inline) { + $inline = $this->buildInlineComment( + $inline, + $on_right = true); + $new_inline_rows[] = $this->getRowScaffoldForInline($inline); + } } + + if ($old_content === null) { + $old_id = null; + $old_label = null; + } else { + $old_id = "C{$old_changeset_key}OL{$old_key}"; + $old_label = $old_key; + } + + $old_line_cell = phutil_tag( + 'td', + array( + 'id' => $old_id, + 'class' => 'n', + ), + $old_label); + + $old_content_cell = phutil_tag( + 'td', + array( + 'class' => $old_classes, + ), + $old_content); + + if ($new_content === null) { + $new_id = null; + $new_label = null; + } else { + $new_id = "C{$new_changeset_key}NL{$new_key}"; + $new_label = $new_key; + } + + $new_line_cell = phutil_tag( + 'td', + array( + 'id' => $new_id, + 'class' => 'n', + ), + $new_label); + + $new_content_cell = phutil_tag( + 'td', + array( + 'class' => $new_classes, + 'colspan' => '3', + ), + $new_content); + + $row_view = phutil_tag( + 'tr', + array(), + array( + $old_line_cell, + $old_content_cell, + $new_line_cell, + $new_content_cell, + )); + + $rows[] = array( + $row_view, + $old_inline_rows, + $new_inline_rows, + ); } - if ($old_view === null) { - $old_id = null; - $old_label = null; - } else { - $old_id = "C{$old_changeset_key}OL1"; - $old_label = '1'; - } - - $old_cell = phutil_tag( - 'td', - array( - 'id' => $old_id, - 'class' => 'n', - ), - $old_label); - - if ($new_view === null) { - $new_id = null; - $new_label = null; - } else { - $new_id = "C{$new_changeset_key}NL1"; - $new_label = '1'; - } - - $new_cell = phutil_tag( - 'td', - array( - 'id' => $new_id, - 'class' => 'n', - ), - $new_label); - - $output = hsprintf( - '