def clone(remote_url, path=None, use_sudo=False, user=None):

    cmd = 'hg --quiet clone %s' % remote_url
    if path is not None:
        cmd = cmd + ' %s' % path

    if use_sudo and user is None:
        run_as_root(cmd)
    elif use_sudo:
        sudo(cmd, user=user)
    else:
        run(cmd)
make sure options in an inheritance chain are applied correctly
dataset/ETHPy150Open ronnix/fabtools/fabtools/mercurial.py/clone--crossover with--dataset/ETHPy150Open unbracketed/python-flot-utils/pyflot/tests/__init__.py/TestFlot.test_options_inheritance