Class: TFSGraph::Populators::ForArchivedBranch

Inherits:
Object
  • Object
show all
Includes:
Utilities
Defined in:
lib/tfs_graph/populators/for_archived_branch.rb

Overview

incremental updates for a branch and its changesets does not update merges. have to do that once all changesets for a project are fetched

Constant Summary

Constants included from StoreHelpers

StoreHelpers::UPDATED_KEY

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

Constructor Details

#initialize(project, branch) ⇒ ForArchivedBranch

Returns a new instance of ForArchivedBranch.



10
11
12
13
14
15
# File 'lib/tfs_graph/populators/for_archived_branch.rb', line 10

def initialize(project, branch)
  @project = project
  @branch = branch

  @changeset_store = ChangesetStore.new(branch)
end

Instance Method Details

#populateObject



17
18
19
20
21
22
23
24
25
# File 'lib/tfs_graph/populators/for_archived_branch.rb', line 17

def populate
  return @branch.changesets unless @branch.changesets.empty?

  all_changesets = @changeset_store.fetch_and_cache
  ChangesetTreeBuilder.to_tree(@branch, all_changesets.sort)

  @branch.updated!
  all_changesets
end