'Find the history of this block. Return as a VersionTree of each place the block changed (except
deletion).
The block\'s history tracks its explicit changes but not the changes in its children starting
from when the block was created.'

def get_block_generations(self, block_locator):

    course_struct = self._lookup_course(block_locator.course_key.course_agnostic()).structure
    block_key = BlockKey.from_usage_key(block_locator)
    all_versions_with_block = self.find_ancestor_structures(original_version=course_struct['original_version'], block_key=block_key)
    possible_roots = []
    result = {}
    for version in all_versions_with_block:
        block_payload = self._get_block_from_structure(version, block_key)
        if (version['_id'] == block_payload.edit_info.update_version):
            if (block_payload.edit_info.previous_version is None):
                possible_roots.append(block_payload.edit_info.update_version)
            else:
                result.setdefault(block_payload.edit_info.previous_version, set()).add(block_payload.edit_info.update_version)
    if (len(possible_roots) > 1):
        element_to_find = self._get_block_from_structure(course_struct, block_key).edit_info.update_version
        if (element_to_find in possible_roots):
            possible_roots = [element_to_find]
        for possibility in possible_roots:
            if self._find_local_root(element_to_find, possibility, result):
                possible_roots = [possibility]
                break
    elif (len(possible_roots) == 0):
        return None
    for (k, versions) in result.iteritems():
        result[k] = [block_locator.for_version(version) for version in versions]
    return VersionTree(block_locator.for_version(possible_roots[0]), result)
