Page MenuHomePhabricator

D10770.diff
No OneTemporary

D10770.diff

diff --git a/src/parser/ArcanistDiffParser.php b/src/parser/ArcanistDiffParser.php
--- a/src/parser/ArcanistDiffParser.php
+++ b/src/parser/ArcanistDiffParser.php
@@ -680,6 +680,8 @@
$line = $this->getLine();
if ($is_svn) {
+ $line = $this->processIDEAComment();
+
$ok = preg_match('/^=+\s*$/', $line);
if (!$ok) {
$this->didFailParse("Expected '=======================' divider line.");
@@ -795,6 +797,31 @@
$this->parseChangeset($change);
}
+ private function processIDEAComment() {
+ $expected_lines = array(
+ 'IDEA additional info:',
+ 'Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP',
+ '<+>UTF-8',
+ );
+
+ if ($this->getLineTrimmed() !== $expected_lines[0]) {
+ // This is not IDEA comment - ignore.
+ return $this->getLine();
+ }
+
+ while ($expected_lines) {
+ $expected_line = array_shift($expected_lines);
+
+ if ($this->getLineTrimmed() !== $expected_line) {
+ $this->didFailParse("Expected '{$expected_line}'.");
+ }
+
+ $this->nextLine();
+ }
+
+ return $this->getLine();
+ }
+
private function parseGitBinaryPatch() {
// TODO: We could decode the patches, but it's a giant mess so don't bother
diff --git a/src/parser/__tests__/ArcanistDiffParserTestCase.php b/src/parser/__tests__/ArcanistDiffParserTestCase.php
--- a/src/parser/__tests__/ArcanistDiffParserTestCase.php
+++ b/src/parser/__tests__/ArcanistDiffParserTestCase.php
@@ -223,6 +223,12 @@
$change->getFileType());
$this->assertEqual(count($change->getHunks()), 0);
break;
+ case 'phpstorm-multiple-files.svndiff':
+ $this->assertEqual(2, count($changes));
+ $change = reset($changes);
+ $this->assertEqual(2, count($change->getHunks()));
+ $this->assertEqual($change->getOldPath(), $change->getCurrentPath());
+ break;
case 'git-delete-file.gitdiff':
$this->assertEqual(1, count($changes));
$change = reset($changes);
diff --git a/src/parser/__tests__/diff/phpstorm-multiple-files.svndiff b/src/parser/__tests__/diff/phpstorm-multiple-files.svndiff
new file mode 100644
--- /dev/null
+++ b/src/parser/__tests__/diff/phpstorm-multiple-files.svndiff
@@ -0,0 +1,39 @@
+Index: themes/advanced/platform/inc/uploader/upload_manager.js
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- themes/advanced/platform/inc/uploader/upload_manager.js (revision 16044)
++++ themes/advanced/platform/inc/uploader/upload_manager.js (revision )
+@@ -100,7 +100,7 @@
+ };
+
+ UploadsManager.AddUploader = function(id, params) {
+- this.Init();
++ this.Init(document.getElementById(id + '[upload]').form.id);
+
+ this._Uploaders[id] = new Uploader(id, params);
+ };
+@@ -349,4 +349,4 @@
+ } else {
+ console.log(message);
+ }
+-};
+\ No newline at end of file
++};
+Index: themes/advanced/platform/inc/form_manager.js
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- themes/advanced/platform/inc/form_manager.js (revision 16044)
++++ themes/advanced/platform/inc/form_manager.js (revision )
+@@ -7,7 +7,7 @@
+ this.fieldMask = '#PREFIX#[#ID#][#FIELD_NAME#]';
+
+ this.noErrorsHTML = '';
+- this.checkTimeout = 1000;
++ this.checkTimeout = 2000;
+ this.pendingChecks = {};
+
+ this.fields = {};

File Metadata

Mime Type
text/plain
Expires
Mar 12 2025, 2:51 AM (8 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7569868
Default Alt Text
D10770.diff (3 KB)

Event Timeline