Command for showing all upgrades already applied.

def applied():
    """Command for showing all upgrades already applied."""
    upgrader = InvenioUpgrader()
    logger = upgrader.get_logger()

    try:
        upgrades = upgrader.get_history()

        if not upgrades:
            logger.info("No upgrades have been applied.")
            return

        logger.info("Following upgrade(s) have been applied:")

        for u_id, applied in upgrades:
            logger.info(" * %s (%s)" % (u_id, applied))
    except RuntimeError as e:
        for msg in e.args:
            logger.error(unicode(msg))
        raise