Class: TFSGraph::Populators::SinceLast
- Inherits:
-
Object
- Object
- TFSGraph::Populators::SinceLast
- Includes:
- Utilities
- Defined in:
- lib/tfs_graph/populators/since_last.rb
Constant Summary
Constants included from StoreHelpers
Instance Method Summary collapse
Methods included from Utilities
#clean, #finalize, #find_branch, #find_project
Methods included from StoreHelpers
#flush_all, #last_updated_on, #mark_as_updated
Instance Method Details
#populate ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/tfs_graph/populators/since_last.rb', line 6 def populate projects = ProjectStore.new.fetch_all existing_projects = RepositoryRegistry.project_repository.all names = existing_projects.map(&:name) new_project_data = projects.reject {|project| names.include? project[:name] } new_projects = ProjectStore.cache_all(new_project_data) existing_projects.concat(new_projects).each do |project| ForProject.new(project).populate branches = BranchStore.new(project).fetch_and_cache changesets = branches.select(&:active?).map do |branch| changesets = ChangesetStore.new(branch).fetch_since_date @since ChangesetTreeBuilder.to_tree(branch, changesets) branch.updated! changesets end # setup merges branches.each {|branch| ChangesetMergeStore.new(branch).fetch_and_cache } ChangesetTreeBuilder.set_branch_merges(changesets) BranchArchiveHandler.hide_moved_archives_for_project(@project) project.updated! end finalize end |