Defect #19835

Newlines stripped from CVS commit messages

Added by Jim Naslund about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:SCM
Target version:3.0.4
Resolution:Fixed Affected version:3.0.3

Description

I noticed this in 3.0.3 but I think the issue was introduced with this change.

This is on Linux with the 3.0.3 tarball, rails 4.2.1, ruby 2.2.2-p95, CVS 1.12.13 and mysql 5.6.24 with the msyql2 adapter.

A quick fix that seems to work is:

diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb
index 92be438..8aceca6 100644
--- a/lib/redmine/scm/adapters/cvs_adapter.rb
+++ b/lib/redmine/scm/adapters/cvs_adapter.rb
@@ -260,7 +260,7 @@ module Redmine
                   #                  version.line_minus = 0
                   #                end
                 else
-                  commit_log << line unless line =~ /^\*\*\* empty log message \*\*\*/
+                  commit_log << line << "\n" unless line =~ /^\*\*\* empty log message \*\*\*/
                 end
               end
             end

but I'm not sure if something should be done with the encoding.

Associated revisions

Revision 14301
Added by Jean-Philippe Lang about 3 years ago

Newlines stripped from CVS commit messages (#19835).

History

#1 Updated by Toshi MARUYAMA about 3 years ago

  • Target version set to 3.0.4

Original change is r13442.

Index: cvs_adapter.rb
===================================================================
--- cvs_adapter.rb    (revision 13441)
+++ cvs_adapter.rb    (revision 13442)
@@ -168,6 +168,7 @@
             file_state = nil
             branch_map = nil
             io.each_line() do |line|
+              line = line.strip
               if state != "revision" && /^#{ENDLOG}/ =~ line
                 commit_log = String.new
                 revision   = nil

I think we can revert this "line = line.strip" addition because Redmine 3.0 does not support JRuby.

#2 Updated by Jean-Philippe Lang about 3 years ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Change reverted.

#3 Updated by Jean-Philippe Lang about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF