def log(target=None, limit=0):
    """Get hg log."""

    assert exists(target), "%s does not exist!" % target

    args = ["log", "--style=xml"]
    if limit != 0:
        args.append("-l")
        args.append(str(limit))
    if target is not None:
        args.append(target)
    output = hgopen(args, dirname(target))

    if output != "":
        results = ET.fromstring(output)
    else:
        results = None

    return results
dataset/ETHPy150Open facelessuser/EasyDiff/lib/hg.py/log/original