Deletes a repository from the graph.
(repo_path: str, context: Optional[str] = None)
| 441 | |
| 442 | |
| 443 | def delete_helper(repo_path: str, context: Optional[str] = None): |
| 444 | """Deletes a repository from the graph.""" |
| 445 | services = _initialize_services(context) |
| 446 | if not all(services[:3]): |
| 447 | _fail_services_init() |
| 448 | |
| 449 | db_manager, graph_builder, _, ctx = services |
| 450 | |
| 451 | try: |
| 452 | if graph_builder.delete_repository_from_graph(repo_path): |
| 453 | console.print(f"[green]Successfully deleted repository: {repo_path}[/green]") |
| 454 | else: |
| 455 | console.print(f"[yellow]Repository not found in graph: {repo_path}[/yellow]") |
| 456 | console.print("[dim]Tip: Use 'cgc list' to see available repositories.[/dim]") |
| 457 | except Exception as e: |
| 458 | console.print(f"[bold red]An error occurred:[/bold red] {e}") |
| 459 | finally: |
| 460 | db_manager.close_driver() |
| 461 | |
| 462 | def _print_query_exception(e: Exception, query: str) -> None: |
| 463 | """ |
no test coverage detected