mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Implement incremental syncback mode to preserve existing file structure
- Added an `incremental` flag to the `SyncbackCommand` to allow for preserving existing file structure and middleware formats during syncback operations. - Enhanced the `syncback_loop` function to differentiate between clean mode and incremental mode, ensuring orphaned files are removed only in clean mode. - Updated logging to reflect the mode of operation during syncback. - Introduced new tests to validate the behavior of clean mode versus incremental mode, ensuring proper handling of orphaned files and preservation of existing structures.
This commit is contained in:
parent
0e5e809894
commit
58399bb863
39 changed files with 652 additions and 119 deletions
|
|
@ -54,6 +54,12 @@ pub struct SyncbackCommand {
|
|||
/// If provided, the prompt for writing to the file system is skipped.
|
||||
#[clap(long, short = 'y')]
|
||||
pub non_interactive: bool,
|
||||
|
||||
/// If provided, syncback will preserve existing file structure and middleware
|
||||
/// formats when possible. Without this flag (default), syncback creates a fresh
|
||||
/// project layout that exactly matches the input file, removing any orphaned files.
|
||||
#[clap(long, short = 'n')]
|
||||
pub incremental: bool,
|
||||
}
|
||||
|
||||
impl SyncbackCommand {
|
||||
|
|
@ -99,12 +105,17 @@ impl SyncbackCommand {
|
|||
}
|
||||
|
||||
let syncback_timer = Instant::now();
|
||||
eprintln!("Beginning syncback...");
|
||||
if self.incremental {
|
||||
eprintln!("Beginning incremental syncback...");
|
||||
} else {
|
||||
eprintln!("Beginning syncback (clean mode)...");
|
||||
}
|
||||
let snapshot = syncback_loop(
|
||||
session_old.vfs(),
|
||||
&mut dom_old,
|
||||
dom_new,
|
||||
session_old.root_project(),
|
||||
self.incremental,
|
||||
)?;
|
||||
log::debug!(
|
||||
"Syncback finished in {:.02}s!",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue