1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

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
This commit is contained in:
Marek Sapota 2011-12-09 15:58:13 -08:00
parent 331afdce87
commit 0788220af4

View file

@ -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;
}