@@ -148,6 +148,15 class Changeset < ActiveRecord::Base | |||||
148 | def self.normalize_comments(str) |
|
148 | def self.normalize_comments(str) | |
149 | to_utf8(str.to_s.strip) |
|
149 | to_utf8(str.to_s.strip) | |
150 | end |
|
150 | end | |
|
151 | ||||
|
152 | # Creates a new Change from it's common parameters | |||
|
153 | def create_change(change) | |||
|
154 | Change.create(:changeset => self, | |||
|
155 | :action => change[:action], | |||
|
156 | :path => change[:path], | |||
|
157 | :from_path => change[:from_path], | |||
|
158 | :from_revision => change[:from_revision]) | |||
|
159 | end | |||
151 |
|
160 | |||
152 | private |
|
161 | private | |
153 |
|
162 |
@@ -85,11 +85,7 class Repository::Darcs < Repository | |||||
85 | :comments => revision.message) |
|
85 | :comments => revision.message) | |
86 |
|
86 | |||
87 | revision.paths.each do |change| |
|
87 | revision.paths.each do |change| | |
88 |
|
|
88 | changeset.create_change(change) | |
89 | :action => change[:action], |
|
|||
90 | :path => change[:path], |
|
|||
91 | :from_path => change[:from_path], |
|
|||
92 | :from_revision => change[:from_revision]) |
|
|||
93 | end |
|
89 | end | |
94 | next_rev += 1 |
|
90 | next_rev += 1 | |
95 | end if revisions |
|
91 | end if revisions |
@@ -78,11 +78,7 class Repository::Mercurial < Repository | |||||
78 | :comments => revision.message) |
|
78 | :comments => revision.message) | |
79 |
|
79 | |||
80 | revision.paths.each do |change| |
|
80 | revision.paths.each do |change| | |
81 |
|
|
81 | changeset.create_change(change) | |
82 | :action => change[:action], |
|
|||
83 | :path => change[:path], |
|
|||
84 | :from_path => change[:from_path], |
|
|||
85 | :from_revision => change[:from_revision]) |
|
|||
86 | end |
|
82 | end | |
87 | end |
|
83 | end | |
88 | end unless revisions.nil? |
|
84 | end unless revisions.nil? |
@@ -63,11 +63,7 class Repository::Subversion < Repository | |||||
63 | :comments => revision.message) |
|
63 | :comments => revision.message) | |
64 |
|
64 | |||
65 | revision.paths.each do |change| |
|
65 | revision.paths.each do |change| | |
66 |
|
|
66 | changeset.create_change(change) | |
67 | :action => change[:action], |
|
|||
68 | :path => change[:path], |
|
|||
69 | :from_path => change[:from_path], |
|
|||
70 | :from_revision => change[:from_revision]) |
|
|||
71 | end unless changeset.new_record? |
|
67 | end unless changeset.new_record? | |
72 | end |
|
68 | end | |
73 | end unless revisions.nil? |
|
69 | end unless revisions.nil? |
General Comments 0
You need to be logged in to leave comments.
Login now