Class: TFSGraph::BranchAssociator

Inherits:
Object
  • Object
show all
Defined in:
lib/tfs_graph/associators/branch_associator.rb

Class Method Summary collapse

Class Method Details

.associate(changesets) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tfs_graph/associators/branch_associator.rb', line 12

def associate(changesets)
  return if changesets.empty?

  change = changesets.first
  root = change.merges.max

  return if root.nil?

  change.parent = root.id
  change.save
end

.associate_groups(sets_by_branch) ⇒ Object

sets up parent/child relationships



6
7
8
9
10
# File 'lib/tfs_graph/associators/branch_associator.rb', line 6

def associate_groups(sets_by_branch)
  sets_by_branch.each do |group|
    associate(group)
  end
end