feat: owner review 2 phase 5a: workspace and projects with a local home #14
No files matched your search
@@ -330,7 +330,8 @@ public sealed class WorkspaceSync(WorkspaceStore store, string clientName)
|
|||||||
if (sync.Conflict is not { } recorded) return new WorkspaceSyncResult(await StatusLockedAsync(project, home, cancellationToken).ConfigureAwait(false), [], []);
|
if (sync.Conflict is not { } recorded) return new WorkspaceSyncResult(await StatusLockedAsync(project, home, cancellationToken).ConfigureAwait(false), [], []);
|
||||||
if (choice == ConflictChoice.SaveBoth)
|
if (choice == ConflictChoice.SaveBoth)
|
||||||
return await SaveBothAsync(project, bundle, home, saveBothName, cancellationToken).ConfigureAwait(false);
|
return await SaveBothAsync(project, bundle, home, saveBothName, cancellationToken).ConfigureAwait(false);
|
||||||
if (choice == ConflictChoice.TakeServer && !bundle.IsReadOnly) CommitLocked(project, bundle, null, null);
|
// A conflict of format refuses the choice (nothing is merged with a newer Chronos's settings): nothing is saved first.
|
||||||
|
if (choice == ConflictChoice.TakeServer && !bundle.IsReadOnly && !recorded.NewerFormat) CommitLocked(project, bundle, null, null);
|
||||||
IReadOnlySet<string> takeTheirs = choice == ConflictChoice.TakeServer ? AllPaths : takeServer ?? new HashSet<string>();
|
IReadOnlySet<string> takeTheirs = choice == ConflictChoice.TakeServer ? AllPaths : takeServer ?? new HashSet<string>();
|
||||||
ProjectSettings? kept = null;
|
ProjectSettings? kept = null;
|
||||||
var (_, conflict, pulled) = await ReplayAsync(project, bundle, home, takeTheirs, cancellationToken, shown ?? recorded, k => kept = k).ConfigureAwait(false);
|
var (_, conflict, pulled) = await ReplayAsync(project, bundle, home, takeTheirs, cancellationToken, shown ?? recorded, k => kept = k).ConfigureAwait(false);
|
||||||
|
|||||||
@@ -159,7 +159,8 @@ public abstract class WorkspaceRecoveryTests(TestContext context) : DatabaseTest
|
|||||||
Assert.Equal(WorkspaceState.InSync, (await one.PushAsync(id, fx.Home, fx.Ct)).Status.State);
|
Assert.Equal(WorkspaceState.InSync, (await one.PushAsync(id, fx.Home, fx.Ct)).Status.State);
|
||||||
var head = Settings(await fx.Home.HeadAsync(id, fx.Ct));
|
var head = Settings(await fx.Home.HeadAsync(id, fx.Ct));
|
||||||
Assert.Equal((1.0, StackSetting.Mean), (head.Exposure.ExposureOffsetEv, head.Stack.Mode));
|
Assert.Equal((1.0, StackSetting.Mean), (head.Exposure.ExposureOffsetEv, head.Stack.Mode));
|
||||||
Assert.SequenceEqual(["first", "other", "second"], (await NotesAsync(fx, id)).Skip(1));
|
// Taking the server's first saves the unsaved offset as a version (kept for its undo); the versions before it reach the home in order.
|
||||||
|
Assert.SequenceEqual(["first", "other", "second"], (await NotesAsync(fx, id)).Skip(1).Take(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
Reference in new issue
Block a user