MCPcopy
hub / github.com/diffgram/diffgram / remove_core

Function remove_core

default/methods/source_control/file/remove.py:65–86  ·  view source on GitHub ↗
(session: Session, working_dir: WorkingDir, existing_file: File, cascade_archive_tasks: bool = False)

Source from the content-addressed store, hash-verified

63
64
65def remove_core(session: Session, working_dir: WorkingDir, existing_file: File, cascade_archive_tasks: bool = False):
66 new_file = File.copy_file_from_existing(
67 session,
68 working_dir,
69 existing_file,
70 remove_link = True,
71 add_link = False)
72
73 new_file.state = "removed"
74 new_file.hash_update()
75 if cascade_archive_tasks:
76 archive_related_tasks(session, existing_file)
77 session.add(new_file)
78 if new_file.type == 'compound':
79 child_file_list = existing_file.get_child_files(session = session)
80 for child in child_file_list:
81 remove_core(session = session,
82 working_dir = working_dir,
83 existing_file = child,
84 cascade_archive_tasks = cascade_archive_tasks)
85
86 return True

Callers 1

remove_fileFunction · 0.85

Calls 5

archive_related_tasksFunction · 0.85
hash_updateMethod · 0.80
get_child_filesMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected