Loading src/cli/entrypoint.py +16 −11 Changes for src/cli/entrypoint.py: 16 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -1223,6 +1223,10 @@ class Entrypoint: # Variables changed: bool input_subpath: str output_subgroup_fullpath: str output_subgroup_namespace: str output_subgroup_path: str # Acquire input group input_group = input_gitlab.group(criteria_input_group) Loading Loading @@ -1250,16 +1254,17 @@ class Entrypoint: input_group.full_path, input_subgroup.full_path, ) output_namespace, output_path = Namespaces.split_namespace( output_subgroup_namespace, output_subgroup_path = Namespaces.split_namespace( input_subpath, relative=True, ) output_subgroup_fullpath = f'{output_subgroup_namespace}/{output_subgroup_path}' # Migration mode if migration: # Ignore existing subgroup if output_gitlab and input_subpath in [ if output_gitlab and f'{output_subgroup_fullpath}' in [ Namespaces.subpath( output_group.full_path, output_subgroup.full_path, Loading @@ -1269,7 +1274,7 @@ class Entrypoint: ) ]: output_subgroup = output_gitlab.group( f'{output_group.full_path}/{input_subpath}') f'{output_group.full_path}{output_subgroup_fullpath}') print(f'{Colors.BOLD} - Already existing subgroup in GitLab output: ' f'{Colors.GREEN}{output_subgroup.full_path}' f'{Colors.CYAN} # {Namespaces.text(output_subgroup.description)}' Loading Loading @@ -1328,13 +1333,13 @@ class Entrypoint: if output_gitlab: print(f'{Colors.BOLD} - Importing to: ' f'{Colors.GREEN}' f'{output_group.full_path}{output_namespace}/{output_path}' f'{output_group.full_path}{output_subgroup_fullpath}' f'{Colors.RESET}') Platform.flush() output_gitlab.group_import( file_export.name, f'{output_group.full_path}{output_namespace}', output_path, f'{output_group.full_path}{output_subgroup_namespace}', output_subgroup_path, input_subgroup.name, ) Loading @@ -1357,10 +1362,10 @@ class Entrypoint: output_subgroup_parent_description: str if not options.dry_run: output_subgroup_parent = output_gitlab.group( f'{output_group.full_path}{output_namespace}') f'{output_group.full_path}{output_subgroup_namespace}') output_subgroup_parent_description = output_subgroup_parent.description output_subgroup_child = output_gitlab.group( f'{output_group.full_path}/{input_subpath}') f'{output_group.full_path}{output_subgroup_fullpath}') output_subgroup_child_description = output_subgroup_child.description output_subgroup_child_name = output_subgroup_child.name else: Loading @@ -1370,7 +1375,7 @@ class Entrypoint: # Update subgroup header print(f'{Colors.BOLD} - Updating subgroup: ' f'{Colors.GREEN}{output_group.full_path}/{input_subpath}' f'{Colors.GREEN}{output_group.full_path}{output_subgroup_fullpath}' f'{Colors.RESET}') Platform.flush() Loading @@ -1384,7 +1389,7 @@ class Entrypoint: description = f'{Namespaces.describe(name=output_subgroup_child_name)}' \ f' - {parent_description}' changed = output_gitlab.group_set_description( f'{output_group.full_path}/{input_subpath}', f'{output_group.full_path}{output_subgroup_fullpath}', description, ) print(f'{Colors.BOLD} - Updated description: ' Loading @@ -1400,7 +1405,7 @@ class Entrypoint: # Set subgroup avatar if options.set_avatar: output_gitlab.group_set_avatar( f'{output_group.full_path}/{input_subpath}', f'{output_group.full_path}{output_subgroup_fullpath}', options.set_avatar, ) print(f'{Colors.BOLD} - Set avatar: ' Loading Loading
src/cli/entrypoint.py +16 −11 Changes for src/cli/entrypoint.py: 16 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -1223,6 +1223,10 @@ class Entrypoint: # Variables changed: bool input_subpath: str output_subgroup_fullpath: str output_subgroup_namespace: str output_subgroup_path: str # Acquire input group input_group = input_gitlab.group(criteria_input_group) Loading Loading @@ -1250,16 +1254,17 @@ class Entrypoint: input_group.full_path, input_subgroup.full_path, ) output_namespace, output_path = Namespaces.split_namespace( output_subgroup_namespace, output_subgroup_path = Namespaces.split_namespace( input_subpath, relative=True, ) output_subgroup_fullpath = f'{output_subgroup_namespace}/{output_subgroup_path}' # Migration mode if migration: # Ignore existing subgroup if output_gitlab and input_subpath in [ if output_gitlab and f'{output_subgroup_fullpath}' in [ Namespaces.subpath( output_group.full_path, output_subgroup.full_path, Loading @@ -1269,7 +1274,7 @@ class Entrypoint: ) ]: output_subgroup = output_gitlab.group( f'{output_group.full_path}/{input_subpath}') f'{output_group.full_path}{output_subgroup_fullpath}') print(f'{Colors.BOLD} - Already existing subgroup in GitLab output: ' f'{Colors.GREEN}{output_subgroup.full_path}' f'{Colors.CYAN} # {Namespaces.text(output_subgroup.description)}' Loading Loading @@ -1328,13 +1333,13 @@ class Entrypoint: if output_gitlab: print(f'{Colors.BOLD} - Importing to: ' f'{Colors.GREEN}' f'{output_group.full_path}{output_namespace}/{output_path}' f'{output_group.full_path}{output_subgroup_fullpath}' f'{Colors.RESET}') Platform.flush() output_gitlab.group_import( file_export.name, f'{output_group.full_path}{output_namespace}', output_path, f'{output_group.full_path}{output_subgroup_namespace}', output_subgroup_path, input_subgroup.name, ) Loading @@ -1357,10 +1362,10 @@ class Entrypoint: output_subgroup_parent_description: str if not options.dry_run: output_subgroup_parent = output_gitlab.group( f'{output_group.full_path}{output_namespace}') f'{output_group.full_path}{output_subgroup_namespace}') output_subgroup_parent_description = output_subgroup_parent.description output_subgroup_child = output_gitlab.group( f'{output_group.full_path}/{input_subpath}') f'{output_group.full_path}{output_subgroup_fullpath}') output_subgroup_child_description = output_subgroup_child.description output_subgroup_child_name = output_subgroup_child.name else: Loading @@ -1370,7 +1375,7 @@ class Entrypoint: # Update subgroup header print(f'{Colors.BOLD} - Updating subgroup: ' f'{Colors.GREEN}{output_group.full_path}/{input_subpath}' f'{Colors.GREEN}{output_group.full_path}{output_subgroup_fullpath}' f'{Colors.RESET}') Platform.flush() Loading @@ -1384,7 +1389,7 @@ class Entrypoint: description = f'{Namespaces.describe(name=output_subgroup_child_name)}' \ f' - {parent_description}' changed = output_gitlab.group_set_description( f'{output_group.full_path}/{input_subpath}', f'{output_group.full_path}{output_subgroup_fullpath}', description, ) print(f'{Colors.BOLD} - Updated description: ' Loading @@ -1400,7 +1405,7 @@ class Entrypoint: # Set subgroup avatar if options.set_avatar: output_gitlab.group_set_avatar( f'{output_group.full_path}/{input_subpath}', f'{output_group.full_path}{output_subgroup_fullpath}', options.set_avatar, ) print(f'{Colors.BOLD} - Set avatar: ' Loading