From 9aeebbbf58ecd05e688647812defde5bcfb95d97 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 10 Jan 2013 09:51:52 -0800 Subject: [PATCH] Fix "context not available" in contextless diffs Summary: D4351 swapped this from a map to a list, and then stopped it from getting to the ChangesetParser so it didn't make it to the Renderer. Test Plan: Ran "arc diff", copy/pasted it into the web UI. Saw a diff with "context not available" blocks in between missing contexts. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2009 Differential Revision: https://secure.phabricator.com/D4384 --- .../differential/parser/DifferentialChangesetParser.php | 2 ++ .../differential/parser/DifferentialHunkParser.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php index abecf15f2c..ab17a30677 100644 --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -593,6 +593,8 @@ final class DifferentialChangesetParser { $this->setNewLines($hunk_parser->getNewLines()); $this->setIntraLineDiffs($hunk_parser->getIntraLineDiffs()); $this->setVisibileLinesMask($hunk_parser->getVisibleLinesMask()); + $this->setMissingOldLineMarkerMap($hunk_parser->getOldLineMarkerMap()); + $this->setMissingNewLineMarkerMap($hunk_parser->getNewLineMarkerMap()); $new_corpus = $hunk_parser->getNewCorpus(); $new_corpus_block = implode('', $new_corpus); diff --git a/src/applications/differential/parser/DifferentialHunkParser.php b/src/applications/differential/parser/DifferentialHunkParser.php index 09bf2945cf..d62ee5c705 100644 --- a/src/applications/differential/parser/DifferentialHunkParser.php +++ b/src/applications/differential/parser/DifferentialHunkParser.php @@ -444,9 +444,9 @@ final class DifferentialHunkParser { $old_line = $hunk->getOldOffset(); $new_line = $hunk->getNewOffset(); if ($old_line > 1) { - $old_line_marker_map[] = $old_line; + $old_line_marker_map[$old_line] = true; } else if ($new_line > 1) { - $new_line_marker_map[] = $new_line; + $new_line_marker_map[$new_line] = true; } $num_lines = count($lines);