diffparser icon indicating copy to clipboard operation
diffparser copied to clipboard

cannot parse SVN-diff

Open aringa opened this issue 8 years ago • 4 comments

using command svn log --diff --verbose URL a unified diff is generated by SVN. When I parse this file, I get the following error:

java.lang.IllegalStateException: A FROM_FILE line ('---') must be directly followed by a TO_FILE line ('+++')! at org.wickedsource.diffparser.unified.ParserState$3.nextState(ParserState.java:76) at org.wickedsource.diffparser.api.UnifiedDiffParser.parse(UnifiedDiffParser.java:64)

aringa avatar Mar 21 '16 12:03 aringa

I added support for diffs created with the "svn diff" command. With Version 1.2 it should work (should be available in maven central shortly).

However, you should use "svn diff" instead of "svn log --diff" since "svn log" adds some noise to the diff which the parser can't handle.

thombergs avatar Mar 23 '16 22:03 thombergs

I can't use svn diff because we need to operate with the (remote) repository, not on the local working copy. Could you enhance the parser to ignore the noise? Thanks.

aringa avatar Mar 24 '16 06:03 aringa

I'm having the same issue but with a proper diff. I can't attach the trouble causing Diff for obvious reasons but I could share privately.

This is on version 1.4.

javydreamercsw avatar Aug 10 '18 15:08 javydreamercsw

On my case there was a XML file in the diff that had a line starting with --->. This was being parsed as a FROM_FILE making the parse fail. I'll have a PR for the issue I found.

javydreamercsw avatar Aug 10 '18 17:08 javydreamercsw