##// END OF EJS Templates
scm: cvs: code clean up adapter entries()....
Toshi MARUYAMA -
r4966:45cba97088a0
parent child
Show More
@@ -103,17 +103,19 module Redmine
103 103 cmd_args << "-D" << time_to_cvstime(identifier) if identifier
104 104 cmd_args << path_with_project
105 105 scm_cmd(*cmd_args) do |io|
106 io.each_line(){|line|
106 io.each_line() do |line|
107 107 fields=line.chop.split('/',-1)
108 108 logger.debug(">>InspectLine #{fields.inspect}")
109
110 109 if fields[0]!="D"
111 entries << Entry.new({:name => fields[-5],
110 entries << Entry.new(
111 {
112 :name => fields[-5],
112 113 #:path => fields[-4].include?(path)?fields[-4]:(path + "/"+ fields[-4]),
113 114 :path => "#{path}/#{fields[-5]}",
114 115 :kind => 'file',
115 116 :size => nil,
116 :lastrev => Revision.new({
117 :lastrev => Revision.new(
118 {
117 119 :revision => fields[-4],
118 120 :name => fields[-4],
119 121 :time => Time.parse(fields[-3]),
@@ -121,14 +123,16 module Redmine
121 123 })
122 124 })
123 125 else
124 entries << Entry.new({:name => fields[1],
126 entries << Entry.new(
127 {
128 :name => fields[1],
125 129 :path => "#{path}/#{fields[1]}",
126 130 :kind => 'dir',
127 131 :size => nil,
128 132 :lastrev => nil
129 133 })
130 134 end
131 }
135 end
132 136 end
133 137 entries.sort_by_name
134 138 rescue ScmCommandAborted
General Comments 0
You need to be logged in to leave comments. Login now