@@ -45,20 +45,22 class Repository::Git < Repository | |||
|
45 | 45 | |
|
46 | 46 | unless changesets.find_by_scmid(scm_revision) |
|
47 | 47 | scm.revisions('', db_revision, nil, :reverse => true) do |revision| |
|
48 | transaction do | |
|
49 | changeset = Changeset.create(:repository => self, | |
|
50 | :revision => revision.identifier, | |
|
51 |
|
|
|
52 |
|
|
|
53 |
:committe |
|
|
54 |
:commen |
|
|
55 | ||
|
56 | revision.paths.each do |change| | |
|
57 | Change.create(:changeset => changeset, | |
|
58 | :action => change[:action], | |
|
59 |
|
|
|
60 |
: |
|
|
61 |
:from_ |
|
|
48 | if changesets.find_by_scmid(revision.scmid.to_s).nil? | |
|
49 | transaction do | |
|
50 | changeset = Changeset.create!(:repository => self, | |
|
51 | :revision => revision.identifier, | |
|
52 | :scmid => revision.scmid, | |
|
53 | :committer => revision.author, | |
|
54 | :committed_on => revision.time, | |
|
55 | :comments => revision.message) | |
|
56 | ||
|
57 | revision.paths.each do |change| | |
|
58 | Change.create!(:changeset => changeset, | |
|
59 | :action => change[:action], | |
|
60 | :path => change[:path], | |
|
61 | :from_path => change[:from_path], | |
|
62 | :from_revision => change[:from_revision]) | |
|
63 | end | |
|
62 | 64 | end |
|
63 | 65 | end |
|
64 | 66 | end |
@@ -42,7 +42,7 class RepositoryGitTest < Test::Unit::TestCase | |||
|
42 | 42 | def test_fetch_changesets_incremental |
|
43 | 43 | @repository.fetch_changesets |
|
44 | 44 | # Remove the 3 latest changesets |
|
45 | @repository.changesets.find(:all, :order => 'id DESC', :limit => 3).each(&:destroy) | |
|
45 | @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy) | |
|
46 | 46 | @repository.reload |
|
47 | 47 | assert_equal 3, @repository.changesets.count |
|
48 | 48 |
General Comments 0
You need to be logged in to leave comments.
Login now