scm: darcs: code clean up model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5448 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
1cd4f5b353
commit
cc534137ba
|
@ -84,20 +84,19 @@ class Repository::Darcs < Repository
|
||||||
scm_info = scm.info
|
scm_info = scm.info
|
||||||
if scm_info
|
if scm_info
|
||||||
db_last_id = latest_changeset ? latest_changeset.scmid : nil
|
db_last_id = latest_changeset ? latest_changeset.scmid : nil
|
||||||
next_rev = latest_changeset ? latest_changeset.revision.to_i + 1 : 1
|
next_rev = latest_changeset ? latest_changeset.revision.to_i + 1 : 1
|
||||||
# latest revision in the repository
|
# latest revision in the repository
|
||||||
scm_revision = scm_info.lastrev.scmid
|
scm_revision = scm_info.lastrev.scmid
|
||||||
unless changesets.find_by_scmid(scm_revision)
|
unless changesets.find_by_scmid(scm_revision)
|
||||||
revisions = scm.revisions('', db_last_id, nil, :with_path => true)
|
revisions = scm.revisions('', db_last_id, nil, :with_path => true)
|
||||||
transaction do
|
transaction do
|
||||||
revisions.reverse_each do |revision|
|
revisions.reverse_each do |revision|
|
||||||
changeset = Changeset.create(:repository => self,
|
changeset = Changeset.create(:repository => self,
|
||||||
:revision => next_rev,
|
:revision => next_rev,
|
||||||
:scmid => revision.scmid,
|
:scmid => revision.scmid,
|
||||||
:committer => revision.author,
|
:committer => revision.author,
|
||||||
:committed_on => revision.time,
|
:committed_on => revision.time,
|
||||||
:comments => revision.message)
|
:comments => revision.message)
|
||||||
|
|
||||||
revision.paths.each do |change|
|
revision.paths.each do |change|
|
||||||
changeset.create_change(change)
|
changeset.create_change(change)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue