mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 08:42:40 +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:
parent
331afdce87
commit
0788220af4
1 changed files with 11 additions and 0 deletions
|
@ -230,12 +230,23 @@ EOTEXT
|
||||||
array(
|
array(
|
||||||
'revision_id' => $revision_id,
|
'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);
|
$commit_paths = array_fill_keys($commit_paths, true);
|
||||||
|
|
||||||
$status = $repository_api->getSVNStatus();
|
$status = $repository_api->getSVNStatus();
|
||||||
|
|
||||||
$modified_but_not_included = array();
|
$modified_but_not_included = array();
|
||||||
foreach ($status as $path => $mask) {
|
foreach ($status as $path => $mask) {
|
||||||
|
if (!empty($dir_paths[$path])) {
|
||||||
|
$commit_paths[$path] = true;
|
||||||
|
}
|
||||||
if (!empty($commit_paths[$path])) {
|
if (!empty($commit_paths[$path])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue