Commit 377bff5f authored by Adrian DC's avatar Adrian DC
Browse files

feat(main, entrypoint): implement '--exclude-subgroups' filter

Signed-off-by: default avatarAdrian DC <radian.dc@gmail.com>
parent 02099760
Loading
Loading
Loading
Loading
Loading
+3 −2
Changes for README.md: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ gitlab-projects-migrate 'https://old.gitlab.com' 'group/subgroup' 'https://new.g
<!-- readme-help-start -->

```yaml
usage: gitlab-projects-migrate [-h] [--version] [-I INPUT_TOKEN] [-O OUTPUT_TOKEN] [--dry-run] [--keep-members]
                               [--overwrite] [--set-avatar FILE] [--update-description]
usage: gitlab-projects-migrate [-h] [--version] [-I INPUT_TOKEN] [-O OUTPUT_TOKEN] [--dry-run] [--exclude-subgroups]
                               [--keep-members] [--overwrite] [--set-avatar FILE] [--update-description]
                               [input_gitlab] [input_path] [output_gitlab] [output_group]

gitlab-projects-migrate: Migrate GitLab projects from a GitLab group to another GitLab's group
@@ -62,6 +62,7 @@ credentials arguments:

migration arguments:
  --dry-run             # Enable dry run mode to check without saving
  --exclude-subgroups   # Exclude children subgroups migration
  --keep-members        # Keep input members after importing on output GitLab
  --overwrite           # Overwrite existing projects on output GitLab

+1 −1
Changes for src/cli/entrypoint.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ class Entrypoint:
            # Iterate through projects
            for input_project in input_group.projects.list(
                    get_all=True,
                    include_subgroups=True,
                    include_subgroups=not options.exclude_subgroups,
                    order_by='path',
                    sort='asc',
            ):
+6
Changes for src/cli/main.py: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -73,6 +73,12 @@ def main() -> None:
        action='store_true',
        help='Enable dry run mode to check without saving',
    )
    group.add_argument(
        '--exclude-subgroups',
        dest='exclude_subgroups',
        action='store_true',
        help='Exclude children subgroups migration',
    )
    group.add_argument(
        '--keep-members',
        dest='keep_members',