@@ -207,22 +207,23 @@ def create_report(mc, directory, since, to, out_file):
207
207
mc (MerginClient): MerginClient instance.
208
208
directory (str): local project directory (must already exist).
209
209
since (str): starting project version tag, for example 'v3'.
210
- to (str): ending project version tag, for example 'v6'.
210
+ to (str): ending project version tag, for example 'v6'. If empty string is passed the latest version will be used.
211
211
out_file (str): output file to save csv in
212
212
213
213
Returns:
214
214
List of warnings/issues for versions which could not be processed (e.g. broken history with missing diff)
215
215
"""
216
216
mp = MerginProject (directory )
217
217
project = mp .metadata ["name" ]
218
- mp .log .info (f"--- Creating changesets report for { project } from { since } to { to } versions ----" )
219
- versions_map = {v ["name" ]: v for v in mc .project_versions (project , since , to )}
218
+ mp .log .info (f"--- Creating changesets report for { project } from { since } to { to if to else 'latest' } versions ----" )
219
+ versions = mc .project_versions (project , since , to if to else None )
220
+ versions_map = {v ["name" ]: v for v in versions }
220
221
headers = ["file" , "table" , "author" , "date" , "time" , "version" , "operation" , "length" , "area" , "count" ]
221
222
records = []
222
223
warnings = []
223
224
info = mc .project_info (project , since = since )
224
225
num_since = int_version (since )
225
- num_to = int_version (to )
226
+ num_to = int_version (to ) if to else int_version ( versions [ - 1 ][ "name" ])
226
227
# filter only .gpkg files
227
228
files = [f for f in info ["files" ] if mp .is_versioned_file (f ["path" ])]
228
229
for f in files :
0 commit comments