feat: preserve nested source projects across desktop and REST
This commit is contained in:
@@ -1021,6 +1021,15 @@ pub fn plan_transition(
|
||||
Ok(plan)
|
||||
}
|
||||
pub fn apply_transition(project: &Project, plan: &TransitionPlan) -> Result<Project, ModelError> {
|
||||
prepare_transition(project, plan).map(|prepared| prepared.project)
|
||||
}
|
||||
|
||||
/// Prepare a reviewed transition once, retaining identity correspondence for
|
||||
/// adapters that update accepted graphical and authored source state together.
|
||||
pub fn prepare_transition(
|
||||
project: &Project,
|
||||
plan: &TransitionPlan,
|
||||
) -> Result<PreparedCommand, ModelError> {
|
||||
if project_fingerprint(project) != plan.base_fingerprint {
|
||||
return Err(ModelError(
|
||||
"Transition preview is stale; create a new preview.".into(),
|
||||
@@ -1031,7 +1040,7 @@ pub fn apply_transition(project: &Project, plan: &TransitionPlan) -> Result<Proj
|
||||
"Resolve transition conflicts before applying.".into(),
|
||||
));
|
||||
}
|
||||
execute_batch(project, &plan.commands)
|
||||
prepare_command(project, &Command::Batch(plan.commands.clone()))
|
||||
}
|
||||
|
||||
/// Supported explicit element counterparts, in stable kind-catalog order.
|
||||
|
||||
Reference in New Issue
Block a user