diff --git a/src/applications/repository/engine/__tests__/data/CHC.svn.tgz b/src/applications/repository/engine/__tests__/data/CHC.svn.tgz index 93da53515b..dbd99c1f1b 100644 Binary files a/src/applications/repository/engine/__tests__/data/CHC.svn.tgz and b/src/applications/repository/engine/__tests__/data/CHC.svn.tgz differ diff --git a/src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php b/src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php index 1194c8922b..170cda5df6 100644 --- a/src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php +++ b/src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php @@ -406,6 +406,280 @@ final class PhabricatorChangeParserTestCase $repository, $commits, array( + // Copy a directory, removing and adding files to the copy + '12' => array( + array( + '/', + null, + null, + DifferentialChangeType::TYPE_CHILD, + DifferentialChangeType::FILE_DIRECTORY, + 0, + 12, + ), + array( + '/dir', + null, + null, + // TODO: This might reasonbly be considered a bug in the parser; it + // should probably be COPY_AWAY. + DifferentialChangeType::TYPE_CHILD, + DifferentialChangeType::FILE_DIRECTORY, + 0, + 12, + ), + array( + '/dir/a', + null, + null, + DifferentialChangeType::TYPE_COPY_AWAY, + DifferentialChangeType::FILE_NORMAL, + 0, + 12, + ), + array( + '/dir/b', + null, + null, + DifferentialChangeType::TYPE_COPY_AWAY, + DifferentialChangeType::FILE_NORMAL, + 0, + 12, + ), + array( + '/dir/subdir', + null, + null, + DifferentialChangeType::TYPE_COPY_AWAY, + DifferentialChangeType::FILE_DIRECTORY, + 0, + 12, + ), + array( + '/dir/subdir/a', + null, + null, + DifferentialChangeType::TYPE_COPY_AWAY, + DifferentialChangeType::FILE_NORMAL, + 0, + 12, + ), + array( + '/dir/subdir/b', + null, + null, + DifferentialChangeType::TYPE_COPY_AWAY, + DifferentialChangeType::FILE_NORMAL, + 0, + 12, + ), + array( + '/dir_copy', + '/dir', + '11', + DifferentialChangeType::TYPE_COPY_HERE, + DifferentialChangeType::FILE_DIRECTORY, + 1, + 12, + ), + array( + '/dir_copy/a', + '/dir/a', + '11', + DifferentialChangeType::TYPE_COPY_HERE, + DifferentialChangeType::FILE_NORMAL, + 1, + 12, + ), + array( + '/dir_copy/b', + '/dir/b', + '11', + DifferentialChangeType::TYPE_COPY_HERE, + DifferentialChangeType::FILE_NORMAL, + 1, + 12, + ), + array( + '/dir_copy/subdir', + '/dir/subdir', + '11', + DifferentialChangeType::TYPE_COPY_HERE, + DifferentialChangeType::FILE_DIRECTORY, + 1, + 12, + ), + array( + '/dir_copy/subdir/a', + '/dir/subdir/a', + '11', + DifferentialChangeType::TYPE_COPY_HERE, + DifferentialChangeType::FILE_NORMAL, + 1, + 12, + ), + array( + '/dir_copy/subdir/b', + '/dir/subdir/b', + '11', + DifferentialChangeType::TYPE_DELETE, + DifferentialChangeType::FILE_NORMAL, + 1, + 12, + ), + array( + '/dir_copy/subdir/c', + null, + null, + DifferentialChangeType::TYPE_ADD, + DifferentialChangeType::FILE_NORMAL, + 1, + 12, + ), + ), + + // Add a directory with a subdirectory and files, sets up next commit + '11' => array( + array( + '/', + null, + null, + DifferentialChangeType::TYPE_CHILD, + DifferentialChangeType::FILE_DIRECTORY, + 0, + 11, + ), + array( + '/dir', + null, + null, + DifferentialChangeType::TYPE_ADD, + DifferentialChangeType::FILE_DIRECTORY, + 1, + 11, + ), + array( + '/dir/a', + null, + null, + DifferentialChangeType::TYPE_ADD, + DifferentialChangeType::FILE_NORMAL, + 1, + 11, + ), + array( + '/dir/b', + null, + null, + DifferentialChangeType::TYPE_ADD, + DifferentialChangeType::FILE_NORMAL, + 1, + 11, + ), + array( + '/dir/subdir', + null, + null, + DifferentialChangeType::TYPE_ADD, + DifferentialChangeType::FILE_DIRECTORY, + 1, + 11, + ), + array( + '/dir/subdir/a', + null, + null, + DifferentialChangeType::TYPE_ADD, + DifferentialChangeType::FILE_NORMAL, + 1, + 11, + ), + array( + '/dir/subdir/b', + null, + null, + DifferentialChangeType::TYPE_ADD, + DifferentialChangeType::FILE_NORMAL, + 1, + 11, + ), + ), + + // Remove directory + '10' => array( + array( + '/', + null, + null, + DifferentialChangeType::TYPE_CHILD, + DifferentialChangeType::FILE_DIRECTORY, + 0, + 10, + ), + array( + '/dir', + null, + null, + DifferentialChangeType::TYPE_DELETE, + DifferentialChangeType::FILE_DIRECTORY, + 1, + 10, + ), + array( + '/dir/subfile', + null, + null, + DifferentialChangeType::TYPE_DELETE, + DifferentialChangeType::FILE_NORMAL, + 1, + 10, + ), + ), + + // Replace directory with file + '9' => array( + array( + '/', + null, + null, + DifferentialChangeType::TYPE_CHILD, + DifferentialChangeType::FILE_DIRECTORY, + 0, + 9, + ), + array( + '/file_moved', + null, + null, + DifferentialChangeType::TYPE_CHANGE, + DifferentialChangeType::FILE_DIRECTORY, + 1, + 9, + ), + ), + + // Replace file with file + '8' => array( + array( + '/', + null, + null, + DifferentialChangeType::TYPE_CHILD, + DifferentialChangeType::FILE_DIRECTORY, + 0, + 8, + ), + array( + '/file_moved', + null, + null, + DifferentialChangeType::TYPE_CHANGE, + DifferentialChangeType::FILE_NORMAL, + 1, + 8, + ), + ), + '7' => array( array( '/', diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php index 2aaaf17c33..5ac6752a17 100644 --- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php @@ -37,7 +37,7 @@ final class PhabricatorRepositorySvnCommitChangeParserWorker // TODO: Explicitly mark this commit as broken elsewhere? This isn't // supposed to happen but we have some cases like rE27 and rG935 in the // Facebook repositories where things got all clowned up. - return; + return array(); } $raw_paths = array();