From 0788220af41668e447c277ae4472dde73cf85a26 Mon Sep 17 00:00:00 2001 From: Marek Sapota Date: Fri, 9 Dec 2011 15:58:13 -0800 Subject: [PATCH] Fix arc commit workflow when new directories were added. Summary: This adds parent directories of modified files to commit paths if needed. Test Plan: Used https://reviews.facebook.net/D603 patch on Apache Hive repository, called `arc commit` and SVN didn't complain about missing paths. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Maniphest Tasks: T667 Differential Revision: 1189 --- src/workflow/commit/ArcanistCommitWorkflow.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/workflow/commit/ArcanistCommitWorkflow.php b/src/workflow/commit/ArcanistCommitWorkflow.php index b6413044..6957bbcd 100644 --- a/src/workflow/commit/ArcanistCommitWorkflow.php +++ b/src/workflow/commit/ArcanistCommitWorkflow.php @@ -230,12 +230,23 @@ EOTEXT array( 'revision_id' => $revision_id, )); + $dir_paths = array(); + foreach ($commit_paths as $path) { + $path = dirname($path); + while ($path != '.') { + $dir_paths[$path] = true; + $path = dirname($path); + } + } $commit_paths = array_fill_keys($commit_paths, true); $status = $repository_api->getSVNStatus(); $modified_but_not_included = array(); foreach ($status as $path => $mask) { + if (!empty($dir_paths[$path])) { + $commit_paths[$path] = true; + } if (!empty($commit_paths[$path])) { continue; }