scm: cvs: code clean up model.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5450 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-13 11:54:42 +00:00
parent 12c856124b
commit b091c98238
1 changed files with 26 additions and 25 deletions

View File

@ -125,7 +125,6 @@ class Repository::Cvs < Repository
# commits in one changeset. cvs update the commit-date when the *,v file was touched. so
# we use a small delta here, to merge all changes belonging to _one_ changeset
time_delta = 10.seconds
fetch_since = latest_changeset ? latest_changeset.committed_on : nil
transaction do
tmp_rev_num = 1
@ -134,14 +133,18 @@ class Repository::Cvs < Repository
# is not exclusive at all.
tmp_time = revision.time.clone
unless changes.find_by_path_and_revision(
scm.with_leading_slash(revision.paths[0][:path]), revision.paths[0][:revision])
scm.with_leading_slash(revision.paths[0][:path]),
revision.paths[0][:revision]
)
cmt = Changeset.normalize_comments(revision.message, repo_log_encoding)
cs = changesets.find(:first, :conditions=>{
cs = changesets.find(
:first,
:conditions => {
:committed_on => tmp_time - time_delta .. tmp_time + time_delta,
:committer => revision.author,
:comments => cmt
})
}
)
# create a new changeset....
unless cs
# we use a temporaray revision number here (just for inserting)
@ -157,7 +160,6 @@ class Repository::Cvs < Repository
:comments => revision.message)
tmp_rev_num += 1
end
# convert CVS-File-States to internal Action-abbrevations
# default action is (M)odified
action = "M"
@ -166,7 +168,6 @@ class Repository::Cvs < Repository
elsif revision.paths[0][:action] == "dead"
action = "D" # dead-state is similar to Delete
end
Change.create(
:changeset => cs,
:action => action,