'Select the child with the oldest generation number'

def select_child(self):

    selected_item = self.selected_item()
    if (selected_item is None):
        return
    child_item = self.oldest_item(selected_item.commit.children)
    if (child_item is None):
        return
    selected_item.setSelected(False)
    child_item.setSelected(True)
    scene_rect = child_item.mapRectToScene(child_item.boundingRect())
    self.ensureVisible(scene_rect)
