Page MenuHomePhabricator

Diff Parse Exception: Expected a hunk header
Closed, InvalidPublic

Description

Hi all,

When I try to create the diff generated by svn diff, it was failed.
The error message is as below:
Diff Parse Exception: Expected a hunk header, like 'Index: /path/to/file.ext' (svn), 'Property changes on: /path/to/file.ext' (svn properties), 'commit 59bcc3ad6775562f845953cf01624225' (git show), 'diff --git' (git diff), '--- filename' (unified diff), or 'diff -r' (hg diff or patch).

          19   +        //测试一下
          20            ddd();
          21        }
          22        yyy(loadComplete, 5);
          23   
>>>       24   ___________________________________________________________________
          25   已修改: svn:mergeinfo
          26      已经合并 /ggg/ttt/trunk/src/http/service.py:r105126-105449

It seems that the lines begin with ____ are not accepted.
But the file was indeed generated by the 'svn diff' command.
Is it a bug?

The sample diff file is attached.

Event Timeline

ykzhujiang raised the priority of this task from to Needs Triage.
ykzhujiang updated the task description. (Show Details)
ykzhujiang updated the task description. (Show Details)
ykzhujiang added a subscriber: ykzhujiang.
chad added a subscriber: chad.

What version of Subversion are you using?

In T7068#93405, @chad wrote:

What version of Subversion are you using?

SVN 1.6.17

You are certainly welcome to update your Subversion to something more modern, though I have no idea if that's an issue.

Basically, we have no other reports of this, and need some means of reproducing the bug in order to develop and test any sort of fix. What system (OS, etc) are you generating this on? Is this just one diff that was an issue or are all diffs giving you this error? Do other people where you work have issues generating diffs?

Hi chad,

Finally, I found that the bug was due to the Chinese character. When I switched to english version svn, I can create diff successfully.

In T7068#93923, @chad wrote:

You are certainly welcome to update your Subversion to something more modern, though I have no idea if that's an issue.

Basically, we have no other reports of this, and need some means of reproducing the bug in order to develop and test any sort of fix. What system (OS, etc) are you generating this on? Is this just one diff that was an issue or are all diffs giving you this error? Do other people where you work have issues generating diffs?

btrahan claimed this task.
btrahan added a subscriber: btrahan.

Its suggested to use Arcanist. e.g.

arc diff

rather than run some svn command directly and pipe things around. arc diff tries really hard to set the language correctly to obviate this sort of issue.

...of course, we do have T5554 still out there, so this isn't perfect yet.