]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Allow 'arc' to parse copies or added files
authorepriestley <git@epriestley.com>
Tue, 28 Jun 2011 23:19:47 +0000 (16:19 -0700)
committerepriestley <git@epriestley.com>
Wed, 29 Jun 2011 20:13:06 +0000 (13:13 -0700)
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

src/parser/diff/ArcanistDiffParser.php

index a027e5c1cb10e3f6af6cfa706661a384389212c8..cd57f107dae3bb7a757b09a3aa12abfe1322370e 100644 (file)
@@ -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;