160 |
160 |
begin
|
161 |
161 |
doc = parse_xml(output)
|
162 |
162 |
each_xml_element(doc['log'], 'logentry') do |logentry|
|
163 |
|
paths = []
|
164 |
|
each_xml_element(logentry['paths'], 'path') do |path|
|
165 |
|
paths << {:action => path['action'],
|
166 |
|
:path => path['__content__'],
|
167 |
|
:from_path => path['copyfrom-path'],
|
168 |
|
:from_revision => path['copyfrom-rev']
|
169 |
|
}
|
170 |
|
end if logentry['paths'] && logentry['paths']['path']
|
171 |
|
paths.sort! { |x,y| x[:path] <=> y[:path] }
|
|
163 |
begin
|
|
164 |
paths = []
|
|
165 |
each_xml_element(logentry['paths'], 'path') do |path|
|
|
166 |
paths << {:action => path['action'],
|
|
167 |
:path => path['__content__'],
|
|
168 |
:from_path => path['copyfrom-path'],
|
|
169 |
:from_revision => path['copyfrom-rev']
|
|
170 |
}
|
|
171 |
end if logentry['paths'] && logentry['paths']['path']
|
|
172 |
paths.sort! { |x,y| x[:path] <=> y[:path] }
|
172 |
173 |
|
173 |
|
revisions << Revision.new({:identifier => logentry['revision'],
|
174 |
|
:author => (logentry['author'] ? logentry['author']['__content__'] : ""),
|
175 |
|
:time => Time.parse(logentry['date']['__content__'].to_s).localtime,
|
176 |
|
:message => logentry['msg']['__content__'],
|
177 |
|
:paths => paths
|
178 |
|
})
|
|
174 |
revisions << Revision.new({:identifier => logentry['revision'],
|
|
175 |
:author => (logentry['author'] ? logentry['author']['__content__'] : ""),
|
|
176 |
:time => Time.parse(logentry['date']['__content__'].to_s).localtime,
|
|
177 |
:message => logentry['msg']['__content__'],
|
|
178 |
:paths => paths
|
|
179 |
})
|
|
180 |
rescue
|
|
181 |
logger.info "Skipped svn revision ##{logentry['revision']} due to parse error" if logentry && logentry['revision']
|
|
182 |
end
|
179 |
183 |
end
|
180 |
184 |
rescue
|
181 |
185 |
end
|