mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
[svn1.7] handle removed directories in svn in arc diff
Summary: `svn rm $directory` removes the directory and its contents in svn 1.7, whereas svn 1.6 only removes the directory's contents, so arc diff needs to not try to read the directory. Test Plan: ran arc diff in a svn working copy that had a directory removed (with both svn 1.6 and svn 1.7) and confirmed that the command did not throw an exception, and that the removed directory was marked as directory (not a file). Reviewers: epriestley, jungejason Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1889
This commit is contained in:
parent
6dd511d0ef
commit
7494a95c40
3 changed files with 15 additions and 0 deletions
|
@ -132,6 +132,12 @@ final class ArcanistDiffParser {
|
|||
|
||||
$from[$path] = $cpath;
|
||||
}
|
||||
$type = $change->getType();
|
||||
if (($type === ArcanistDiffChangeType::TYPE_MOVE_AWAY ||
|
||||
$type === ArcanistDiffChangeType::TYPE_DELETE) &&
|
||||
idx($info, 'Node Kind') === 'directory') {
|
||||
$change->setFileType(ArcanistDiffChangeType::FILE_DIRECTORY);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($paths as $path => $status) {
|
||||
|
|
|
@ -291,6 +291,7 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
|
|||
'/^(Copied From URL): (\S+)$/m',
|
||||
'/^(Copied From Rev): (\d+)$/m',
|
||||
'/^(Repository UUID): (\S+)$/m',
|
||||
'/^(Node Kind): (\S+)$/m',
|
||||
);
|
||||
|
||||
$result = array();
|
||||
|
@ -426,6 +427,10 @@ EODIFF;
|
|||
return null;
|
||||
}
|
||||
|
||||
if (!file_exists($full_path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = Filesystem::readFile($full_path);
|
||||
$lines = explode("\n", $data);
|
||||
$len = count($lines);
|
||||
|
|
|
@ -753,6 +753,10 @@ abstract class ArcanistBaseWorkflow {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (!file_exists($full_path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$change = $this->getChange($path);
|
||||
|
||||
if ($change->getFileType() !== ArcanistDiffChangeType::FILE_TEXT) {
|
||||
|
|
Loading…
Reference in a new issue