MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / delete_helper

Function delete_helper

src/codegraphcontext/cli/cli_helpers.py:443–460  ·  view source on GitHub ↗

Deletes a repository from the graph.

(repo_path: str, context: Optional[str] = None)

Source from the content-addressed store, hash-verified

441
442
443def 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
462def _print_query_exception(e: Exception, query: str) -> None:
463 """

Callers 1

deleteFunction · 0.85

Calls 5

_initialize_servicesFunction · 0.85
_fail_services_initFunction · 0.85
printMethod · 0.80
close_driverMethod · 0.45

Tested by

no test coverage detected