import json


def create_patch_command(app, patch):
    """
    Parameters
    ----------
    app : `str`
        The app to patch.
    patch : `dict`
        The patch dictionary containing the targetRevision change.

    Returns
    -------
    `list`
        The patch command to run.
    """
    cmd = [
        "argocd",
        "app",
        "patch",
        f"{app}",
        "--patch",
        f"{json.dumps(patch)}",
        "--type",
        "merge",
    ]
    return cmd