@@ -98,26 +98,31 class Repository::Git < Repository | |||||
98 | unless revisions.nil? |
|
98 | unless revisions.nil? | |
99 | revisions.each do |rev| |
|
99 | revisions.each do |rev| | |
100 | transaction do |
|
100 | transaction do | |
101 | changeset = Changeset.new( |
|
101 | save_revision(rev) | |
102 | :repository => self, |
|
102 | end | |
103 | :revision => rev.identifier, |
|
103 | end | |
104 | :scmid => rev.scmid, |
|
104 | end | |
105 | :committer => rev.author, |
|
105 | end | |
|
106 | ||||
|
107 | def save_revision(rev) | |||
|
108 | changeset = Changeset.new( | |||
|
109 | :repository => self, | |||
|
110 | :revision => rev.identifier, | |||
|
111 | :scmid => rev.scmid, | |||
|
112 | :committer => rev.author, | |||
106 | :committed_on => rev.time, |
|
113 | :committed_on => rev.time, | |
107 |
:comments => rev.message |
|
114 | :comments => rev.message | |
108 |
|
115 | ) | ||
109 |
|
|
116 | if changeset.save | |
110 |
|
|
117 | rev.paths.each do |file| | |
111 |
|
|
118 | Change.create( | |
112 | :changeset => changeset, |
|
119 | :changeset => changeset, | |
113 | :action => file[:action], |
|
120 | :action => file[:action], | |
114 | :path => file[:path]) |
|
121 | :path => file[:path]) | |
115 | end |
|
|||
116 | end |
|
|||
117 | end |
|
|||
118 | end |
|
122 | end | |
119 | end |
|
123 | end | |
120 | end |
|
124 | end | |
|
125 | private :save_revision | |||
121 |
|
126 | |||
122 | def latest_changesets(path,rev,limit=10) |
|
127 | def latest_changesets(path,rev,limit=10) | |
123 | revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false) |
|
128 | revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false) |
General Comments 0
You need to be logged in to leave comments.
Login now