From 3d7a1d936cc74f9223dd2f913b33d13f4dd66e11 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 31 Jan 2012 12:07:41 -0800 Subject: [PATCH] Fix issue where all rows in "Revision Update History" render the same base Summary: We were not correctly updating $diff as we iterated through the loop. Test Plan: Viewed a revision several diffs that had differing base revision. Reviewers: fratrik, btrahan Reviewed By: fratrik CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1523 --- .../DifferentialRevisionUpdateHistoryView.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/differential/view/revisionupdatehistory/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/revisionupdatehistory/DifferentialRevisionUpdateHistoryView.php index c9a787b42b..5b08a163c9 100644 --- a/src/applications/differential/view/revisionupdatehistory/DifferentialRevisionUpdateHistoryView.php +++ b/src/applications/differential/view/revisionupdatehistory/DifferentialRevisionUpdateHistoryView.php @@ -88,6 +88,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView { $last_base = null; foreach ($data as $row) { + $diff = $row['obj']; $name = phutil_escape_html($row['name']); $id = phutil_escape_html($row['id']); @@ -148,21 +149,22 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView { $class = null; } - if ($row['obj']) { + if ($diff) { $lint = self::renderDiffLintStar($row['obj']); $unit = self::renderDiffUnitStar($row['obj']); $lint_message = self::getDiffLintMessage($diff); $unit_message = self::getDiffUnitMessage($diff); $lint_title = ' title="'.phutil_escape_html($lint_message).'"'; $unit_title = ' title="'.phutil_escape_html($unit_message).'"'; + $base = $this->renderBaseRevision($diff); } else { $lint = null; $unit = null; $lint_title = null; $unit_title = null; + $base = null; } - $base = $this->renderBaseRevision($diff); if ($last_base !== null && $base !== $last_base) { // TODO: Render some kind of notice about rebases. }