def format_signature_validity(rev_id, branch):
    """get the signature validity

    :param rev_id: revision id to validate
    :param branch: branch of revision
    :return: human readable string to print to log
    """
    from breezy import gpg
    gpg_strategy = gpg.GPGStrategy(branch.get_config_stack())
    result = branch.repository.verify_revision_signature(rev_id, gpg_strategy)
    if result[0] == gpg.SIGNATURE_VALID:
        return u'valid signature from {0}'.format(result[1])
    if result[0] == gpg.SIGNATURE_KEY_MISSING:
        return 'unknown key {0}'.format(result[1])
    if result[0] == gpg.SIGNATURE_NOT_VALID:
        return 'invalid signature!'
    if result[0] == gpg.SIGNATURE_NOT_SIGNED:
        return 'no signature'
