From: epriestley Date: Tue, 28 Jun 2011 23:19:47 +0000 (-0700) Subject: Allow 'arc' to parse copies or added files X-Git-Tag: conduit-4~296 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ffeeeb8c55a94ac5d23abe03629442d765bd3324;p=arcanist.git Allow 'arc' to parse copies or added files Summary: See task. This is a bizarre edge case which we incorrectly reject but should do our best with. Test Plan: Created an added copy of a file and diffed it successfully. Reviewed By: alex Reviewers: alex, jungejason, tuomaspelkonen, aran CC: aran, alex Differential Revision: 547 --- diff --git a/src/parser/diff/ArcanistDiffParser.php b/src/parser/diff/ArcanistDiffParser.php index a027e5c1..cd57f107 100644 --- a/src/parser/diff/ArcanistDiffParser.php +++ b/src/parser/diff/ArcanistDiffParser.php @@ -151,6 +151,10 @@ class ArcanistDiffParser { switch ($type) { case ArcanistDiffChangeType::TYPE_MULTICOPY: case ArcanistDiffChangeType::TYPE_COPY_AWAY: + // "Add" is possible if you do some bizarre tricks with svn:ignore and + // "svn copy"'ing URLs straight from the repository; you can end up with + // a file that is a copy of itself. See T271. + case ArcanistDiffChangeType::TYPE_ADD: break; case ArcanistDiffChangeType::TYPE_DELETE: $origin->setType(ArcanistDiffChangeType::TYPE_MOVE_AWAY); @@ -171,6 +175,7 @@ class ArcanistDiffParser { case ArcanistDiffChangeType::TYPE_MOVE_AWAY: $change->setType(ArcanistDiffChangeType::TYPE_MOVE_HERE); break; + case ArcanistDiffChangeType::TYPE_ADD: case ArcanistDiffChangeType::TYPE_COPY_AWAY: $change->setType(ArcanistDiffChangeType::TYPE_COPY_HERE); break;