1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-29 18:22:41 +01:00

Parse property change diffs generated with old SVN (prior to 1.5)

Summary:
Fixes T2565. SVN from before June 2008 generates different looking property changes.

See http://subversion.tigris.org/issues/show_bug.cgi?id=3019 for the change.

Test Plan: Added a unit test derived from the report in T2565, made it pass.

Reviewers: chad, vrana

Reviewed By: chad

CC: aran

Maniphest Tasks: T2565

Differential Revision: https://secure.phabricator.com/D5009
This commit is contained in:
epriestley 2013-02-19 07:32:57 -08:00
parent 1e612eebc3
commit 4e688b0e0e
3 changed files with 31 additions and 2 deletions

View file

@ -377,10 +377,17 @@ final class ArcanistDiffParser {
break; break;
} }
// NOTE: Before 1.5, SVN uses "Name". At 1.5 and later, SVN uses
// "Modified", "Added" and "Deleted".
$matches = null; $matches = null;
$ok = preg_match('/^(Modified|Added|Deleted): (.*)$/', $line, $matches); $ok = preg_match(
'/^(Name|Modified|Added|Deleted): (.*)$/',
$line,
$matches);
if (!$ok) { if (!$ok) {
$this->didFailParse("Expected 'Added', 'Deleted', or 'Modified'."); $this->didFailParse(
"Expected 'Name', 'Added', 'Deleted', or 'Modified'.");
} }
$op = $matches[1]; $op = $matches[1];

View file

@ -190,6 +190,24 @@ Merged /tfb/branches/ads-create-v3/www/html/js/help/UIFaq.js:r140558-142418
EOTEXT EOTEXT
)); ));
break; break;
case 'svn-property-older-than-1.5.svndiff':
// In SVN 1.5, the format for property diffs changed to use the words
// "Added", "Deleted" and "Modified" instead of "Name". This is an old
// property change diff which uses "Name".
$this->assertEqual(1, count($changes));
$change = reset($changes);
$this->assertEqual(count($change->getHunks()), 0);
$this->assertEqual(
$change->getOldProperties(),
array(
));
$this->assertEqual(
$change->getNewProperties(),
array(
'svn:executable' => '*',
));
break;
case 'svn-binary-add.svndiff': case 'svn-binary-add.svndiff':
$this->assertEqual(1, count($changes)); $this->assertEqual(1, count($changes));
$change = reset($changes); $change = reset($changes);

View file

@ -0,0 +1,4 @@
Property changes on: ancient/crypt/tomb.COBOL
___________________________________________________________________
Name: svn:executable
+ *