forked from rojo-rbx/rojo
Move instigating source out of contributing paths (#253)
* Refactor contributing_paths into contributing_sources, deleting project node sources * Instead of changing contributing_paths, add instigating_source * Remove InstanceMetadata::project_node * Stop pushing project path to front of contributing_paths since it doesn't matter now * Remove accidental UI change for path display
This commit is contained in:
committed by
GitHub
parent
2025b8a494
commit
052ca52cc3
@@ -11,7 +11,7 @@ use jod_thread::JoinHandle;
|
||||
use crate::{
|
||||
imfs::{Imfs, ImfsEvent, ImfsFetcher},
|
||||
message_queue::MessageQueue,
|
||||
snapshot::{apply_patch_set, compute_patch_set, AppliedPatchSet, RojoTree},
|
||||
snapshot::{apply_patch_set, compute_patch_set, AppliedPatchSet, InstigatingSource, RojoTree},
|
||||
snapshot_middleware::snapshot_from_imfs,
|
||||
};
|
||||
|
||||
@@ -84,22 +84,32 @@ impl ChangeProcessor {
|
||||
let metadata = tree.get_metadata(id)
|
||||
.expect("metadata missing for instance present in tree");
|
||||
|
||||
let instigating_path = match metadata.contributing_paths.get(0) {
|
||||
let instigating_source = match &metadata.instigating_source {
|
||||
Some(path) => path,
|
||||
None => {
|
||||
log::warn!("Instance {} did not have an instigating path, but was considered for an update.", id);
|
||||
log::warn!("Instance {} did not have an instigating source, but was considered for an update.", id);
|
||||
log::warn!("This is a Rojo bug. Please file an issue!");
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
let entry = imfs
|
||||
.get(instigating_path)
|
||||
.expect("could not get instigating path from filesystem");
|
||||
let snapshot = match instigating_source {
|
||||
InstigatingSource::Path(instigating_path) => {
|
||||
let entry = imfs
|
||||
.get(instigating_path)
|
||||
.expect("could not get instigating path from filesystem");
|
||||
|
||||
let snapshot = snapshot_from_imfs(&mut imfs, &entry)
|
||||
.expect("snapshot failed")
|
||||
.expect("snapshot did not return an instance");
|
||||
let snapshot = snapshot_from_imfs(&mut imfs, &entry)
|
||||
.expect("snapshot failed")
|
||||
.expect("snapshot did not return an instance");
|
||||
|
||||
snapshot
|
||||
}
|
||||
InstigatingSource::ProjectNode(_, _) => {
|
||||
log::warn!("Instance {} had an instigating source that was a project node, which is not yet supported.", id);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
log::trace!("Computed snapshot: {:#?}", snapshot);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user