Skip to content

Commit

Permalink
Three-way diffing Synchronizer (#1707)
Browse files Browse the repository at this point in the history
* Work on the new synchronizer

* Rough draft of mappings

* Fix some broken rules

* Good stopping place for the weekend, can build a sync plan from the disk state and game state

* Fixing the loadout synchronizer tests one by one

* Loadout syncronizer tests pass

* Fix disk diff code

* It compiles, time to run the full test suite

* All tests pass

* Benchmarks are all messed up, but fixed up the rest of the app

* Delete the outdated benchmarks :(

* Fix more tests

* Fix executable bit setting on *nix

* Fix a bug with deleted files

* Add some docs/ADRs documenting the process

* Add a test around SMAPI moving files into mods during ingestion, fixed an error with the sync code exposed by the test

* Make the signature builder struct readonly

* Remove default leg from the giant switch expression
  • Loading branch information
halgari authored Jul 2, 2024
1 parent 0f6e088 commit a4703d0
Show file tree
Hide file tree
Showing 50 changed files with 2,089 additions and 1,769 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,4 @@ protected void Init(string baseModName, string fileList)
_installation = _datamodel.BaseLoadout.InstallationInstance;
_diskStateRegistry = _serviceProvider.GetRequiredService<IDiskStateRegistry>();
}

protected void InitForIngest()
{
// We apply the files of a new loadout (without updating the loadout itself)
// This way we have loose files to ingest.
Task.Run(async () =>
{
// Do an apply, but without updating the loadout revision.
var flattenedLoadout = await _defaultSynchronizer.LoadoutToFlattenedLoadout(_datamodel.BaseLoadout);
var fileTree = await _defaultSynchronizer.FlattenedLoadoutToFileTree(flattenedLoadout, _datamodel.BaseLoadout);
var prevState = _datamodel.DiskStateRegistry.GetState(_installation)!;
await _defaultSynchronizer.FileTreeToDiskImpl(fileTree, _datamodel.BaseLoadout, flattenedLoadout, prevState, _installation,false);
}).Wait();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Task BackupFiles(IEnumerable<ArchivedFileEntry> backups, CancellationToke
return Task.CompletedTask;
}

public Task ExtractFiles((Hash Hash, AbsolutePath Dest)[] files, CancellationToken token = default)
public Task ExtractFiles(IEnumerable<(Hash Hash, AbsolutePath Dest)> files, CancellationToken token = default)
{
return Task.CompletedTask;
}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit a4703d0

Please sign in to comment.