##// 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 77 changeset_to=changesets.find_by_revision(rev_to)
78 78 end
79 79 changeset_from.changes.each() do |change_from|
80
81 80 revision_from=nil
82 81 revision_to=nil
83
84 revision_from=change_from.revision if path.nil? || (change_from.path.starts_with? scm.with_leading_slash(path))
85
82 if path.nil? || (change_from.path.starts_with? scm.with_leading_slash(path))
83 revision_from=change_from.revision
84 end
86 85 if revision_from
87 86 if changeset_to
88 87 changeset_to.changes.each() do |change_to|
@@ -101,7 +100,8 class Repository::Cvs < Repository
101 100
102 101 def fetch_changesets
103 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 105 # we now take a guess using the author, the commitlog and the commit-date.
106 106
107 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 150 action="D" #dead-state is similar to Delete
151 151 end
152 152
153 Change.create(:changeset => cs,
153 Change.create(
154 :changeset => cs,
154 155 :action => action,
155 156 :path => scm.with_leading_slash(revision.paths[0][:path]),
156 157 :revision => revision.paths[0][:revision],
@@ -161,7 +162,9 class Repository::Cvs < Repository
161 162
162 163 # Renumber new changesets in chronological order
163 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 168 ).each do |changeset|
166 169 changeset.update_attribute :revision, next_revision_number
167 170 end
General Comments 0
You need to be logged in to leave comments. Login now