##// END OF EJS Templates
scm: cvs: code clean up lib/redmine/scm/adapters/cvs_adapter.rb....
Toshi MARUYAMA -
r5260:c6ec41473e62
parent child
Show More
@@ -70,7 +70,7 module Redmine
70 70 @url = url
71 71 @login = login if login && !login.empty?
72 72 @password = (password || "") if @login
73 #TODO: better Exception here (IllegalArgumentException)
73 # TODO: better Exception here (IllegalArgumentException)
74 74 raise CommandFailed if root_url.blank?
75 75 @root_url = root_url
76 76 end
@@ -127,9 +127,9 module Redmine
127 127 :lastrev => Revision.new(
128 128 {
129 129 :revision => fields[-4],
130 :name => fields[-4],
131 :time => time,
132 :author => ''
130 :name => fields[-4],
131 :time => time,
132 :author => ''
133 133 })
134 134 })
135 135 else
@@ -163,25 +163,21 module Redmine
163 163 cmd_args << "-d" << ">#{time_to_cvstime_rlog(identifier_from)}" if identifier_from
164 164 cmd_args << path_with_project
165 165 scm_cmd(*cmd_args) do |io|
166 state="entry_start"
167
168 commit_log=String.new
169 revision=nil
170 date=nil
171 author=nil
172 entry_path=nil
173 entry_name=nil
174 file_state=nil
175 branch_map=nil
176
166 state = "entry_start"
167 commit_log = String.new
168 revision = nil
169 date = nil
170 author = nil
171 entry_path = nil
172 entry_name = nil
173 file_state = nil
174 branch_map = nil
177 175 io.each_line() do |line|
178
179 if state!="revision" && /^#{ENDLOG}/ =~ line
180 commit_log=String.new
181 revision=nil
182 state="entry_start"
176 if state != "revision" && /^#{ENDLOG}/ =~ line
177 commit_log = String.new
178 revision = nil
179 state = "entry_start"
183 180 end
184
185 181 if state=="entry_start"
186 182 branch_map=Hash.new
187 183 if /^RCS file: #{Regexp.escape(root_url_path)}\/#{Regexp.escape(path_with_project)}(.+),v$/ =~ line
@@ -350,11 +346,11 module Redmine
350 346 t1 = time.clone.localtime
351 347 return t1.strftime("%Y-%m-%d %H:%M:%S")
352 348 end
353
349
354 350 def normalize_cvs_path(path)
355 351 normalize_path(path.gsub(/Attic\//,''))
356 352 end
357
353
358 354 def normalize_path(path)
359 355 path.sub(/^(\/)*(.*)/,'\2').sub(/(.*)(,v)+/,'\1')
360 356 end
General Comments 0
You need to be logged in to leave comments. Login now