# HG changeset patch # User Artem Tikhomirov # Date 1298579812 -3600 # Node ID 7a908ba66ff33d826cf3cffd4d4d645defe9b8b8 # Parent 305ee74c0aa685c5827498e81c3e62405d206da5 Correctly parse comments with newlines inside diff -r 305ee74c0aa6 -r 7a908ba66ff3 test/org/tmatesoft/hg/test/LogOutputParser.java --- a/test/org/tmatesoft/hg/test/LogOutputParser.java Thu Feb 24 20:14:11 2011 +0100 +++ b/test/org/tmatesoft/hg/test/LogOutputParser.java Thu Feb 24 21:36:52 2011 +0100 @@ -35,13 +35,15 @@ private Pattern pattern2; private Pattern pattern3; private Pattern pattern4; + private Pattern pattern5; public LogOutputParser(boolean outputWithDebug) { if (outputWithDebug) { pattern1 = Pattern.compile("^changeset:\\s+(\\d+):([a-f0-9]{40})\n(^tag:(.+)$)?", Pattern.MULTILINE); pattern2 = Pattern.compile("^parent:\\s+(-?\\d+):([a-f0-9]{40})\n", Pattern.MULTILINE); pattern3 = Pattern.compile("^manifest:\\s+(\\d+):([a-f0-9]{40})\nuser:\\s+(\\S.+)\ndate:\\s+(\\S.+)\n", Pattern.MULTILINE); - pattern4 = Pattern.compile("^description:\n^(.+)\n\n", Pattern.MULTILINE); + pattern4 = Pattern.compile("^description:\\n", Pattern.MULTILINE); + pattern5 = Pattern.compile("\\n\\n"); //p = "^manifest:\\s+(\\d+):([a-f0-9]{40})\nuser:(.+)$"; } else { throw HgRepository.notImplemented(); @@ -79,7 +81,11 @@ } m.usePattern(pattern4); if (m.find()) { - r.description = m.group(1); + int commentStart = m.end(); + m.usePattern(pattern5); + if (m.find()) { + r.description = seq.subSequence(commentStart, m.start()).toString(); + } } result.add(r); m.usePattern(pattern1);