|
83 | 83 | """ |
84 | 84 |
|
85 | 85 | import click |
86 | | -from git import NULL_TREE |
87 | 86 |
|
88 | | -from renku.core.commands.client import pass_local_client |
89 | 87 | from renku.core.commands.format.graph import FORMATS |
90 | | -from renku.core.commands.graph import Graph |
| 88 | +from renku.core.commands.graph import build_graph |
91 | 89 |
|
92 | 90 |
|
93 | 91 | @click.command() |
|
96 | 94 | @click.option("--no-output", is_flag=True, default=False, help="Display commands without output files.") |
97 | 95 | @click.option("--strict", is_flag=True, default=False, help="Validate triples before output.") |
98 | 96 | @click.argument("paths", type=click.Path(exists=False), nargs=-1) |
99 | | -@pass_local_client(requires_migration=True) |
100 | | -def log(client, revision, format, no_output, strict, paths): |
| 97 | +def log(revision, format, no_output, strict, paths): |
101 | 98 | """Show logs for a file.""" |
102 | | - graph = Graph(client) |
103 | | - if not paths: |
104 | | - start, is_range, stop = revision.partition("..") |
105 | | - if not is_range: |
106 | | - stop = start |
107 | | - elif not stop: |
108 | | - stop = "HEAD" |
109 | | - |
110 | | - commit = client.repo.rev_parse(stop) |
111 | | - paths = ( |
112 | | - str(client.path / item.a_path) |
113 | | - for item in commit.diff(commit.parents or NULL_TREE) |
114 | | - # if not item.deleted_file |
115 | | - ) |
116 | | - |
117 | | - # NOTE shall we warn when "not no_output and not paths"? |
118 | | - graph.build(paths=paths, revision=revision, can_be_cwl=no_output) |
| 99 | + graph = build_graph(revision, no_output, paths) |
119 | 100 | FORMATS[format](graph, strict=strict) |
0 commit comments