def diff(target, last=False):
    """Diff current file against last revision."""

    args = None

    assert exists(target), target % "%s does not exist!"
    if last:
        revs = getrevision(target, 2)
        if len(revs) == 2:
            args = ["diff", "-p", "-r", revs[1]]
    else:
        args = ["diff", "-p"]

    return hgopen(args + [target], dirname(target)) if args is not None else b""
dataset/ETHPy150Open facelessuser/EasyDiff/lib/hg.py/diff/swapped operands of `%`