def is_ancestor(repo, rev1, rev2):
    '''return true if rev1 is an ancestor of rev2'''
    sha1 = find_revision_sha(repo, rev1)
    sha2 = find_revision_sha(repo, rev2)
    return True if sha1 in merge_base(repo, sha1, sha2) else False
return true if rev1 is an ancestor of rev2
lib/git/gitutils.py