code: def is_ancestor(self, ancestor_rev, rev):
          
          try:
              self.git.merge_base(ancestor_rev, rev, is_ancestor=True)
          except GitCommandError as err:
              if err.status == 1:
                  return False
              raise
          return True
docs: Check if a commit  is an ancestor of another
  
          :param ancestor_rev: Rev which should be an ancestor
          :param rev: Rev to test against ancestor_rev
          :return: ``True``, ancestor_rev is an accestor to rev.