]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix issue with SVN property changes under Windows
authorepriestley <git@epriestley.com>
Wed, 20 Feb 2013 21:24:14 +0000 (13:24 -0800)
committerepriestley <git@epriestley.com>
Wed, 20 Feb 2013 21:24:14 +0000 (13:24 -0800)
Summary: We were incorrectly matching `$` in the regexp against a possible `\r\n`. I missed this earlier when trying to catch all of these.

Test Plan:
  - Added unit test and made it pass.
  - Did another search for `getLine()` to see if I could spot any more of these, but failed to identify any via inspection.

Reviewers: vrana, mbishopim3

Reviewed By: mbishopim3

CC: aran
Differential Revision: https://secure.phabricator.com/D5038

src/parser/ArcanistDiffParser.php
src/parser/__tests__/ArcanistDiffParserTestCase.php
src/parser/__tests__/diff/svn-property-windows.svndiff [new file with mode: 0644]

index 0ba2b247e78a169157152692ce66ef4918371e4f..180ce7008519b72f5d3a1531e7ffd8a36a085f9f 100644 (file)
@@ -365,7 +365,7 @@ final class ArcanistDiffParser {
    * (or any other parser) with a carefully constructed property change.
    */
   protected function parsePropertyHunk(ArcanistDiffChange $change) {
-    $line = $this->getLine();
+    $line = $this->getLineTrimmed();
     if (!preg_match('/^_+$/', $line)) {
       $this->didFailParse("Expected '______________________'.");
     }
index 1ef73820466ab30f0870d43e41e8510cf4adc168..e4ddec81c24bc7c583ec4c54cb8075fe7d91c0e1 100644 (file)
@@ -546,6 +546,9 @@ EOTEXT
       case 'suppress-blank-empty.gitdiff':
         $this->assertEqual(1, count($changes));
         break;
+      case 'svn-property-windows.svndiff':
+        $this->assertEqual(1, count($changes));
+        break;
       default:
         throw new Exception("No test block for diff file {$diff_file}.");
         break;
diff --git a/src/parser/__tests__/diff/svn-property-windows.svndiff b/src/parser/__tests__/diff/svn-property-windows.svndiff
new file mode 100644 (file)
index 0000000..bbe367f
--- /dev/null
@@ -0,0 +1,11 @@
+Index: .arcconfig\r
+===================================================================\r
+--- .arcconfig  (revision 1957)\r
++++ .arcconfig  (working copy)\r
+\r
+Property changes on: .arcconfig\r
+___________________________________________________________________\r
+Added: herp\r
+## -0,0 +1 ##\r
++derp\r
+\ No newline at end of property