summaryrefslogtreecommitdiffstats
path: root/app/models/repository/cvs.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-07 10:26:15 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-07 10:26:15 +0000
commit109fd2cdfc880a1b91bf6e658e4bc35c6bdcf85f (patch)
treed4f3081867eb9669b8ac044246683f25f15f2e78 /app/models/repository/cvs.rb
parente9ab2de1e79719f832d4fa8b0bbeebbd55d7bc28 (diff)
downloadredmine-109fd2cdfc880a1b91bf6e658e4bc35c6bdcf85f.tar.gz
redmine-109fd2cdfc880a1b91bf6e658e4bc35c6bdcf85f.zip
scm: cvs: generate pseudo scmid for auto issue close text (#6706).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4802 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository/cvs.rb')
-rw-r--r--app/models/repository/cvs.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb
index 8ea4f2301..dbbb4694f 100644
--- a/app/models/repository/cvs.rb
+++ b/app/models/repository/cvs.rb
@@ -104,10 +104,11 @@ class Repository::Cvs < Repository
scm.revisions('', fetch_since, nil, :with_paths => true) do |revision|
# only add the change to the database, if it doen't exists. the cvs log
# 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])
cs = changesets.find(:first, :conditions=>{
- :committed_on=>revision.time-time_delta..revision.time+time_delta,
+ :committed_on=>tmp_time - time_delta .. tmp_time + time_delta,
:committer=>revision.author,
:comments=>Changeset.normalize_comments(revision.message)
})
@@ -116,10 +117,14 @@ class Repository::Cvs < Repository
unless cs
# we use a temporaray revision number here (just for inserting)
# later on, we calculate a continous positive number
+ tmp_time2 = tmp_time.clone.gmtime
+ branch = revision.paths[0][:branch]
+ scmid = branch + "-" + tmp_time2.strftime("%Y%m%d-%H%M%S")
cs = Changeset.create(:repository => self,
- :revision => "tmp#{tmp_rev_num}",
+ :revision => "tmp#{tmp_rev_num}",
+ :scmid => scmid,
:committer => revision.author,
- :committed_on => revision.time,
+ :committed_on => tmp_time,
:comments => revision.message)
tmp_rev_num += 1
end