diffparser
diffparser copied to clipboard
cannot parse SVN-diff
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)
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.
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.
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.
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.