mergin/cli.py
def show_file_history(ctx, path):
    """Displays information about a single version of a project."""
    mc = ctx.obj["client"]
    if mc is None:
        return
    directory = os.getcwd()
    mp = MerginProject(directory)
    project_path = mp.metadata["name"]
    info_dict = mc.project_file_history_info(project_path, path)
    # TODO: handle exception if history not found
    history_dict = info_dict["history"]
    click.secho("File history: " + info_dict["path"])
    click.secho("-----")
    for version, version_data in history_dict.items():
        diff_info = ""
        if "diff" in version_data:
            diff_info = "diff ({} bytes)".format(version_data["diff"]["size"])
        click.secho(" {:5} {:10} {}".format(version, version_data["change"], diff_info))
Displays information about a single version of a project.
Displays information about a single version of a project.
Displays information about a single version of a project .
def show_file_history(ctx, path):
    mc = ctx.obj["client"]
    if mc is None:
        return
    directory = os.getcwd()
    mp = MerginProject(directory)
    project_path = mp.metadata["name"]
    info_dict = mc.project_file_history_info(project_path, path)
    history_dict = info_dict["history"]
    click.secho("File history: " + info_dict["path"])
    click.secho("-----")
    for version, version_data in history_dict.items():
        diff_info = ""
        if "diff" in version_data:
            diff_info = "diff ({} bytes)".format(version_data["diff"]["size"])
        click.secho(" {:5} {:10} {}".format(version, version_data["change"], diff_info))
def show_file_history ( ctx , path ) : mc = ctx . obj [ "client" ] if mc is None : return directory = os . getcwd ( ) mp = MerginProject ( directory ) project_path = mp . metadata [ "name" ] info_dict = mc . project_file_history_info ( project_path , path ) history_dict = info_dict [ "history" ] click . secho ( "File history: " + info_dict [ "path" ] ) click . secho ( "-----" ) for version , version_data in history_dict . items ( ) : diff_info = "" if "diff" in version_data : diff_info = "diff ({} bytes)" . format ( version_data [ "diff" ] [ "size" ] ) click . secho ( " {:5} {:10} {}" . format ( version , version_data [ "change" ] , diff_info ) )
Displays information about a single version of a project.
Displays information about a single version of a project .
"""Displays information about a single version of a project.""" # TODO: handle exception if history not found
ctx
path