Commit 7b3e80ca7d533c6586c4238986228520ec3b62c9

output less from rebuild_events

Commit diff

script/rebuild_events

 
77
88abort("Usage: #{$0} repo_id") unless ARGV[0]
99
10$stdout.sync = true
11
1012def create_repo_creation_events_for(project)
1113 project.repository_clones.each do |repo|
1214 puts "creating Repository clone event in #{project.slug}/#{repo.name}"
13 # project.create_event(Action::CLONE_REPOSITORY, repo, repo.user, repo.parent_id)
1415 project.events.create({
1516 :action => Action::CLONE_REPOSITORY,
1617 :target => repo,
2525def create_comment_events_for(repo, project)
2626 repo.comments.each do |comment|
2727 puts "creating Comment event on #{project.slug}/#{repo.name}"
28 #project.create_event(Action::COMMENT, comment, comment.user)
2928 project.events.create({
3029 :action => Action::COMMENT,
3130 :target => comment,
6767 users_commits[commit.committer.email] ||= []
6868 users_commits[commit.committer.email] << commit
6969 end
70
70
7171 users = User.find(:all, :conditions => ['email in (?)', users_commits.keys] )
7272 users.each do |user|
7373 commits = users_commits[user.email]
74
74 puts "\nindexing #{commits.size} commits for #{user.email} in #{project.slug}/#{repo.name}:#{head.name}"
7575 commits.each_index do |i|
7676 commit = commits[i]
7777 previous_commit = commits[i-1]
152152 end
153153 end
154154
155 puts "#{current_rev_type}#{action.inspect} in #{project.slug}/#{repo.name}:#{head.name}: #{commit.short_message}"
156 #project.create_event(action_id, repo, user, commit.id, commit.message)
155 print "." if (i % 10 == 1)
156 #puts "#{current_rev_type}#{action.inspect} in #{project.slug}/#{repo.name}:#{head.name}: #{commit.short_message}"
157157 project.events.create({
158158 :action => action_id || Action::COMMIT,
159159 :target => repo,
163163 :created_at => commit.committed_date})
164164 end
165165 commits = nil
166 puts
166167 end
167168 users_commits = nil
168169 end
toggle raw diff