diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-01 07:47:04 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2014-02-01 07:47:04 +0000 |
commit | ae68ff11004d6a0bae0affd41b3a9823c30fb75c (patch) | |
tree | 5ae0365039bb92c4172ad03d5ae0e59b2acd279d /app/models | |
parent | 6ea2b7a43b7e5e55ff549285db5c6764cf530f8b (diff) | |
download | redmine-ae68ff11004d6a0bae0affd41b3a9823c30fb75c.tar.gz redmine-ae68ff11004d6a0bae0affd41b3a9823c30fb75c.zip |
scm: mercurial: use long id in adapter level (#14361)
git-svn-id: http://svn.redmine.org/redmine/trunk@12752 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/repository/mercurial.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index 5eedbb7eb..42ac32913 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -152,16 +152,24 @@ class Repository::Mercurial < Repository (db_rev + 1).step(scm_rev, FETCH_AT_ONCE) do |i| scm.each_revision('', i, [i + FETCH_AT_ONCE - 1, scm_rev].min) do |re| transaction do - parents = (re.parents || []).collect{|rp| find_changeset_by_name(rp)}.compact + scmid = re.scmid[0, 12] + parents = (re.parents || []).collect do |rp| + find_changeset_by_name(rp[0, 12]) + end.compact cs = Changeset.create(:repository => self, :revision => re.revision, - :scmid => re.scmid, + :scmid => scmid, :committer => re.author, :committed_on => re.time, :comments => re.message, :parents => parents) unless cs.new_record? - re.paths.each { |e| cs.create_change(e) } + re.paths.each do |e| + if from_revision = e[:from_revision] + e[:from_revision] = from_revision[0, 12] + end + cs.create_change(e) + end end end end |