(
repo_root: &Path,
graph: RefactorGraph,
options: ExecutionOptions,
)
| 436 | } |
| 437 | |
| 438 | pub fn execute_refactor( |
| 439 | repo_root: &Path, |
| 440 | graph: RefactorGraph, |
| 441 | options: ExecutionOptions, |
| 442 | ) -> Result<RefactorStatus> { |
| 443 | let mut executor = RefactorExecutor::new(repo_root.to_path_buf()); |
| 444 | let id = executor.begin_refactor(&graph)?; |
| 445 | let status = executor.apply_nodes(&id, &graph, &options)?; |
| 446 | if status.failed_nodes.is_empty() { |
| 447 | executor.commit(&id)?; |
| 448 | } |
| 449 | Ok(status) |
| 450 | } |
| 451 | |
| 452 | #[cfg(test)] |
| 453 | mod tests { |
searching dependent graphs…