From 03aca35ccec20f5293834c408c74c37f305a902d Mon Sep 17 00:00:00 2001 From: vrana Date: Wed, 21 Nov 2012 11:08:07 -0800 Subject: [PATCH] Create new paths in Differential Summary: It is used by 'Pending Differential Revisions'. Test Plan: Created a new file, `arc diff`, looked at this path in Diffusion, saw Pending Differential Revisions. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3991 --- .../editor/DifferentialRevisionEditor.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/applications/differential/editor/DifferentialRevisionEditor.php b/src/applications/differential/editor/DifferentialRevisionEditor.php index 37f7b29119..ee1b23ff9c 100644 --- a/src/applications/differential/editor/DifferentialRevisionEditor.php +++ b/src/applications/differential/editor/DifferentialRevisionEditor.php @@ -807,21 +807,15 @@ final class DifferentialRevisionEditor extends PhabricatorEditor { } $all_paths = array_keys($all_paths); - $path_map = id(new DiffusionPathIDQuery($all_paths))->loadPathIDs(); + $path_ids = + PhabricatorRepositoryCommitChangeParserWorker::lookupOrCreatePaths( + $all_paths); $table = new DifferentialAffectedPath(); $conn_w = $table->establishConnection('w'); $sql = array(); - foreach ($all_paths as $path) { - $path_id = idx($path_map, $path); - if (!$path_id) { - // Don't bother creating these, it probably means we're either adding - // a file (in which case having this row is irrelevant since Diffusion - // won't be querying for it) or something is misconfigured (in which - // case we'd just be writing garbage). - continue; - } + foreach ($path_ids as $path_id) { $sql[] = qsprintf( $conn_w, '(%d, %d, %d, %d)',