##// END OF EJS Templates
scm: cvs: code clean up app/models/repository/cvs.rb....
Toshi MARUYAMA -
r5256:18431d3681e0
parent child
Show More
@@ -77,12 +77,11 class Repository::Cvs < Repository
77 changeset_to=changesets.find_by_revision(rev_to)
77 changeset_to=changesets.find_by_revision(rev_to)
78 end
78 end
79 changeset_from.changes.each() do |change_from|
79 changeset_from.changes.each() do |change_from|
80
81 revision_from=nil
80 revision_from = nil
82 revision_to=nil
81 revision_to = nil
83
82 if path.nil? || (change_from.path.starts_with? scm.with_leading_slash(path))
84 revision_from=change_from.revision if path.nil? || (change_from.path.starts_with? scm.with_leading_slash(path))
83 revision_from=change_from.revision
85
84 end
86 if revision_from
85 if revision_from
87 if changeset_to
86 if changeset_to
88 changeset_to.changes.each() do |change_to|
87 changeset_to.changes.each() do |change_to|
@@ -101,7 +100,8 class Repository::Cvs < Repository
101
100
102 def fetch_changesets
101 def fetch_changesets
103 # some nifty bits to introduce a commit-id with cvs
102 # some nifty bits to introduce a commit-id with cvs
104 # natively cvs doesn't provide any kind of changesets, there is only a revision per file.
103 # natively cvs doesn't provide any kind of changesets,
104 # there is only a revision per file.
105 # we now take a guess using the author, the commitlog and the commit-date.
105 # we now take a guess using the author, the commitlog and the commit-date.
106
106
107 # last one is the next step to take. the commit-date is not equal for all
107 # last one is the next step to take. the commit-date is not equal for all
@@ -150,7 +150,8 class Repository::Cvs < Repository
150 action="D" #dead-state is similar to Delete
150 action="D" #dead-state is similar to Delete
151 end
151 end
152
152
153 Change.create(:changeset => cs,
153 Change.create(
154 :changeset => cs,
154 :action => action,
155 :action => action,
155 :path => scm.with_leading_slash(revision.paths[0][:path]),
156 :path => scm.with_leading_slash(revision.paths[0][:path]),
156 :revision => revision.paths[0][:revision],
157 :revision => revision.paths[0][:revision],
@@ -161,7 +162,9 class Repository::Cvs < Repository
161
162
162 # Renumber new changesets in chronological order
163 # Renumber new changesets in chronological order
163 changesets.find(
164 changesets.find(
164 :all, :order => 'committed_on ASC, id ASC', :conditions => "revision LIKE 'tmp%'"
165 :all,
166 :order => 'committed_on ASC, id ASC',
167 :conditions => "revision LIKE 'tmp%'"
165 ).each do |changeset|
168 ).each do |changeset|
166 changeset.update_attribute :revision, next_revision_number
169 changeset.update_attribute :revision, next_revision_number
167 end
170 end
General Comments 0
You need to be logged in to leave comments. Login now