1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-01 19:22:41 +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:
Nick Harper 2012-03-13 23:42:05 -07:00
parent 6dd511d0ef
commit 7494a95c40
3 changed files with 15 additions and 0 deletions

View file

@ -132,6 +132,12 @@ final class ArcanistDiffParser {
$from[$path] = $cpath; $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) { foreach ($paths as $path => $status) {

View file

@ -291,6 +291,7 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
'/^(Copied From URL): (\S+)$/m', '/^(Copied From URL): (\S+)$/m',
'/^(Copied From Rev): (\d+)$/m', '/^(Copied From Rev): (\d+)$/m',
'/^(Repository UUID): (\S+)$/m', '/^(Repository UUID): (\S+)$/m',
'/^(Node Kind): (\S+)$/m',
); );
$result = array(); $result = array();
@ -426,6 +427,10 @@ EODIFF;
return null; return null;
} }
if (!file_exists($full_path)) {
return null;
}
$data = Filesystem::readFile($full_path); $data = Filesystem::readFile($full_path);
$lines = explode("\n", $data); $lines = explode("\n", $data);
$len = count($lines); $len = count($lines);

View file

@ -753,6 +753,10 @@ abstract class ArcanistBaseWorkflow {
return null; return null;
} }
if (!file_exists($full_path)) {
return null;
}
$change = $this->getChange($path); $change = $this->getChange($path);
if ($change->getFileType() !== ArcanistDiffChangeType::FILE_TEXT) { if ($change->getFileType() !== ArcanistDiffChangeType::FILE_TEXT) {