1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 15:21:03 +01:00

Fix SVN commit change parser for files moved from deleted directory

Summary: This is not perfect. Moved files are reported as deleted but I'm happy with it.

Test Plan: Reparsed two commits which was previously wrong, now semi-correct.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Maniphest Tasks: T1114

Differential Revision: https://secure.phabricator.com/D2215
This commit is contained in:
vrana 2012-04-12 00:25:30 -07:00
parent 9a29107d01
commit 17b0277ec5

View file

@ -159,6 +159,7 @@ class PhabricatorRepositorySvnCommitChangeParserWorker
}
} else {
$type = DifferentialChangeType::TYPE_DELETE;
}
$file_type = $path_file_types[$path];
if ($file_type == DifferentialChangeType::FILE_DIRECTORY) {
@ -176,18 +177,27 @@ class PhabricatorRepositorySvnCommitChangeParserWorker
// TODO: Unclear how this is possible.
continue;
}
$effect_type = $type;
$effect_target_path = null;
if (isset($copied_or_moved_map[$deleted_path])) {
$effect_target_path = $path;
if (count($copied_or_moved_map[$deleted_path]) > 1) {
$effect_type = DifferentialChangeType::TYPE_MULTICOPY;
} else {
$effect_type = DifferentialChangeType::TYPE_MOVE_AWAY;
}
}
$effects[$deleted_path] = array(
'rawPath' => $deleted_path,
'rawTargetPath' => null,
'rawTargetPath' => $effect_target_path,
'rawTargetCommit' => null,
'rawDirect' => true,
'changeType' => $type,
'changeType' => $effect_type,
'fileType' => $path_file_type,
);
}
}
}
break;
case 'A':
$copy_from = $raw_info['rawTargetPath'];
@ -217,7 +227,8 @@ class PhabricatorRepositorySvnCommitChangeParserWorker
}
if ($source_file_type != DifferentialChangeType::FILE_DIRECTORY) {
if (isset($raw_paths[$copy_from])) {
if (isset($raw_paths[$copy_from]) ||
isset($effects[$copy_from])) {
break;
}
$effects[$copy_from] = array(