revisions.reject!{|r| recent_revisions.include?(r.scmid)}
# Save the remaining ones to the database
- revisions.each{|r| r.save(self)} unless revisions.nil?
+ unless revisions.nil?
+ revisions.each do |rev|
+ transaction do
+ changeset = Changeset.new(
+ :repository => self,
+ :revision => rev.identifier,
+ :scmid => rev.scmid,
+ :committer => rev.author,
+ :committed_on => rev.time,
+ :comments => rev.message)
+
+ if changeset.save
+ rev.paths.each do |file|
+ Change.create(
+ :changeset => changeset,
+ :action => file[:action],
+ :path => file[:path])
+ end
+ end
+ end
+ end
+ end
end
def latest_changesets(path,rev,limit=10)
def format_identifier
identifier
end
-
- def save(repo)
- Changeset.transaction do
- changeset = Changeset.new(
- :repository => repo,
- :revision => identifier,
- :scmid => scmid,
- :committer => author,
- :committed_on => time,
- :comments => message)
-
- if changeset.save
- paths.each do |file|
- Change.create(
- :changeset => changeset,
- :action => file[:action],
- :path => file[:path])
- end
- end
- end
- end
end
class Annotate