@fluidframework/tree 2.4.0-297027 → 2.4.0-297385
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/change-family/changeFamily.d.ts +2 -2
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/editBuilder.d.ts +3 -2
- package/dist/core/change-family/editBuilder.d.ts.map +1 -1
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +2 -1
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/utils.js +1 -1
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +4 -3
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +41 -30
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -6
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +4 -4
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +12 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +179 -60
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +10 -9
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +9 -7
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -10
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +32 -20
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts +6 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +25 -9
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -16
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +19 -11
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +1 -1
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +4 -4
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +15 -11
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +4 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +2 -3
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +10 -11
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts +5 -5
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +4 -4
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +1 -1
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +2 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +2 -2
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/editBuilder.d.ts +3 -2
- package/lib/core/change-family/editBuilder.d.ts.map +1 -1
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +2 -1
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/utils.js +1 -1
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +4 -3
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +41 -30
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -6
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +4 -4
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +12 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +180 -61
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +10 -9
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +9 -7
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -10
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +32 -20
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts +6 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +25 -9
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +17 -16
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +19 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +1 -1
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +4 -4
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +15 -11
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +5 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +2 -3
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +11 -12
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts +5 -5
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +4 -4
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +2 -2
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +2 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/package.json +23 -23
- package/src/core/change-family/changeFamily.ts +5 -2
- package/src/core/change-family/editBuilder.ts +3 -2
- package/src/core/rebase/changeRebaser.ts +6 -1
- package/src/core/rebase/utils.ts +1 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +92 -47
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +7 -7
- package/src/feature-libraries/mitigatedChangeFamily.ts +11 -4
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +1 -0
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +218 -175
- package/src/feature-libraries/optional-field/optionalField.ts +21 -17
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -10
- package/src/feature-libraries/sequence-field/compose.ts +67 -58
- package/src/feature-libraries/sequence-field/invert.ts +30 -6
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +65 -19
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/sharedTree.ts +3 -1
- package/src/shared-tree/sharedTreeChangeFamily.ts +5 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +23 -12
- package/src/shared-tree/treeCheckout.ts +7 -6
- package/src/shared-tree-core/branch.ts +11 -14
- package/src/shared-tree-core/defaultResubmitMachine.ts +4 -4
- package/src/shared-tree-core/editManager.ts +2 -1
- package/src/shared-tree-core/sharedTreeCore.ts +4 -2
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
ChangeFamilyEditor,
|
|
9
|
+
RevisionTag,
|
|
10
|
+
TaggedChange,
|
|
11
|
+
TreeStoredSchema,
|
|
12
|
+
} from "../core/index.js";
|
|
8
13
|
import {
|
|
9
14
|
DefaultEditBuilder,
|
|
10
15
|
type IDefaultEditBuilder,
|
|
@@ -48,14 +53,17 @@ export class SharedTreeEditBuilder
|
|
|
48
53
|
|
|
49
54
|
public constructor(
|
|
50
55
|
modularChangeFamily: ModularChangeFamily,
|
|
51
|
-
|
|
56
|
+
mintRevisionTag: () => RevisionTag,
|
|
57
|
+
private readonly changeReceiver: (change: TaggedChange<SharedTreeChange>) => void,
|
|
52
58
|
idCompressor?: IIdCompressor,
|
|
53
59
|
) {
|
|
54
60
|
super(
|
|
55
61
|
modularChangeFamily,
|
|
56
|
-
|
|
62
|
+
mintRevisionTag,
|
|
63
|
+
(taggedChange) =>
|
|
57
64
|
changeReceiver({
|
|
58
|
-
|
|
65
|
+
...taggedChange,
|
|
66
|
+
change: { changes: [{ type: "data", innerChange: taggedChange.change }] },
|
|
59
67
|
}),
|
|
60
68
|
idCompressor,
|
|
61
69
|
);
|
|
@@ -63,15 +71,18 @@ export class SharedTreeEditBuilder
|
|
|
63
71
|
this.schema = {
|
|
64
72
|
setStoredSchema: (oldSchema, newSchema) => {
|
|
65
73
|
this.changeReceiver({
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
revision: mintRevisionTag(),
|
|
75
|
+
change: {
|
|
76
|
+
changes: [
|
|
77
|
+
{
|
|
78
|
+
type: "schema",
|
|
79
|
+
innerChange: {
|
|
80
|
+
schema: { new: newSchema, old: oldSchema },
|
|
81
|
+
isInverse: false,
|
|
82
|
+
},
|
|
72
83
|
},
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
],
|
|
85
|
+
},
|
|
75
86
|
});
|
|
76
87
|
},
|
|
77
88
|
};
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
TreeStoredSchemaRepository,
|
|
33
33
|
type TreeStoredSchemaSubscription,
|
|
34
34
|
combineVisitors,
|
|
35
|
-
makeAnonChange,
|
|
36
35
|
makeDetachedFieldIndex,
|
|
37
36
|
rebaseChange,
|
|
38
37
|
rootFieldKey,
|
|
@@ -785,15 +784,17 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
785
784
|
const revertibleBranch = this.revertibleCommitBranches.get(revision);
|
|
786
785
|
assert(revertibleBranch !== undefined, 0x7cc /* expected to find a revertible commit */);
|
|
787
786
|
const commitToRevert = revertibleBranch.getHead();
|
|
787
|
+
const revisionForInvert = this.mintRevisionTag();
|
|
788
788
|
|
|
789
|
-
let change =
|
|
790
|
-
this.changeFamily.rebaser.invert(
|
|
789
|
+
let change = tagChange(
|
|
790
|
+
this.changeFamily.rebaser.invert(commitToRevert, false, revisionForInvert),
|
|
791
|
+
revisionForInvert,
|
|
791
792
|
);
|
|
792
793
|
|
|
793
794
|
const headCommit = this._branch.getHead();
|
|
794
795
|
// Rebase the inverted change onto any commits that occurred after the undoable commits.
|
|
795
796
|
if (commitToRevert !== headCommit) {
|
|
796
|
-
change =
|
|
797
|
+
change = tagChange(
|
|
797
798
|
rebaseChange(
|
|
798
799
|
this.changeFamily.rebaser,
|
|
799
800
|
change,
|
|
@@ -801,12 +802,12 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
801
802
|
headCommit,
|
|
802
803
|
this.mintRevisionTag,
|
|
803
804
|
).change,
|
|
805
|
+
revisionForInvert,
|
|
804
806
|
);
|
|
805
807
|
}
|
|
806
808
|
|
|
807
809
|
this._branch.apply(
|
|
808
|
-
change
|
|
809
|
-
this.mintRevisionTag(),
|
|
810
|
+
change,
|
|
810
811
|
kind === CommitKind.Default || kind === CommitKind.Redo
|
|
811
812
|
? CommitKind.Undo
|
|
812
813
|
: CommitKind.Redo,
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
makeAnonChange,
|
|
19
19
|
mintCommit,
|
|
20
20
|
rebaseBranch,
|
|
21
|
-
tagChange,
|
|
22
21
|
tagRollbackInverse,
|
|
23
22
|
type RebaseStatsWithDuration,
|
|
24
23
|
} from "../core/index.js";
|
|
@@ -224,8 +223,8 @@ export class SharedTreeBranch<
|
|
|
224
223
|
>,
|
|
225
224
|
) {
|
|
226
225
|
super();
|
|
227
|
-
this.editor = this.changeFamily.buildEditor((change) =>
|
|
228
|
-
this.apply(change
|
|
226
|
+
this.editor = this.changeFamily.buildEditor(mintRevisionTag, (change) =>
|
|
227
|
+
this.apply(change),
|
|
229
228
|
);
|
|
230
229
|
this.unsubscribeBranchTrimmer = branchTrimmer?.on("ancestryTrimmed", (commit) => {
|
|
231
230
|
this.emit("ancestryTrimmed", commit);
|
|
@@ -243,37 +242,35 @@ export class SharedTreeBranch<
|
|
|
243
242
|
|
|
244
243
|
/**
|
|
245
244
|
* Apply a change to this branch.
|
|
246
|
-
* @param
|
|
247
|
-
* @param revision - the revision of the new head commit of the branch that contains `change`
|
|
245
|
+
* @param taggedChange - the change to apply
|
|
248
246
|
* @param kind - the kind of change to apply
|
|
249
247
|
* @returns the change that was applied and the new head commit of the branch
|
|
250
248
|
*/
|
|
251
249
|
public apply(
|
|
252
|
-
|
|
253
|
-
revision: RevisionTag,
|
|
250
|
+
taggedChange: TaggedChange<TChange>,
|
|
254
251
|
kind: CommitKind = CommitKind.Default,
|
|
255
252
|
): [change: TChange, newCommit: GraphCommit<TChange>] {
|
|
256
253
|
this.assertNotDisposed();
|
|
257
254
|
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
const revisionTag = taggedChange.revision;
|
|
256
|
+
assert(revisionTag !== undefined, "Revision tag must be provided");
|
|
260
257
|
|
|
261
258
|
const newHead = mintCommit(this.head, {
|
|
262
|
-
revision,
|
|
263
|
-
change:
|
|
259
|
+
revision: revisionTag,
|
|
260
|
+
change: taggedChange.change,
|
|
264
261
|
});
|
|
265
262
|
|
|
266
263
|
const changeEvent = {
|
|
267
264
|
type: "append",
|
|
268
265
|
kind,
|
|
269
|
-
change:
|
|
266
|
+
change: taggedChange,
|
|
270
267
|
newCommits: [newHead],
|
|
271
268
|
} as const;
|
|
272
269
|
|
|
273
270
|
this.emit("beforeChange", changeEvent);
|
|
274
271
|
this.head = newHead;
|
|
275
272
|
this.emit("afterChange", changeEvent);
|
|
276
|
-
return [
|
|
273
|
+
return [taggedChange.change, newHead];
|
|
277
274
|
}
|
|
278
275
|
|
|
279
276
|
/**
|
|
@@ -371,7 +368,7 @@ export class SharedTreeBranch<
|
|
|
371
368
|
const commit =
|
|
372
369
|
commits[i] ?? fail("This wont run because we are iterating through commits");
|
|
373
370
|
const inverse = this.changeFamily.rebaser.changeRevision(
|
|
374
|
-
this.changeFamily.rebaser.invert(commit, true),
|
|
371
|
+
this.changeFamily.rebaser.invert(commit, true, revision),
|
|
375
372
|
revision,
|
|
376
373
|
commit.revision,
|
|
377
374
|
);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert, oob } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import type {
|
|
7
|
+
import type { GraphCommit, TaggedChange } from "../core/index.js";
|
|
8
8
|
import { disposeSymbol } from "../util/index.js";
|
|
9
9
|
import type { ChangeEnricherReadonlyCheckout, ResubmitMachine } from "./index.js";
|
|
10
10
|
|
|
@@ -36,9 +36,9 @@ export class DefaultResubmitMachine<TChange> implements ResubmitMachine<TChange>
|
|
|
36
36
|
|
|
37
37
|
public constructor(
|
|
38
38
|
/**
|
|
39
|
-
* A function that can
|
|
39
|
+
* A function that can create a rollback for a given change.
|
|
40
40
|
*/
|
|
41
|
-
private readonly
|
|
41
|
+
private readonly makeRollback: (change: TaggedChange<TChange>) => TChange,
|
|
42
42
|
/**
|
|
43
43
|
* Change enricher that represent the tip of the top-level local branch (i.e., the branch on which in-flight
|
|
44
44
|
* commits are applied and automatically rebased).
|
|
@@ -75,7 +75,7 @@ export class DefaultResubmitMachine<TChange> implements ResubmitMachine<TChange>
|
|
|
75
75
|
// Roll back the checkout to the state before the oldest commit
|
|
76
76
|
for (let iCommit = toResubmit.length - 1; iCommit >= 0; iCommit -= 1) {
|
|
77
77
|
const commit = toResubmit[iCommit] ?? oob();
|
|
78
|
-
const rollback = this.
|
|
78
|
+
const rollback = this.makeRollback(commit);
|
|
79
79
|
// WARNING: it's not currently possible to roll back past a schema change (see AB#7265).
|
|
80
80
|
// Either we have to make it possible to do so, or this logic will have to change to work
|
|
81
81
|
// forwards from an earlier fork instead of backwards.
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
mintCommit,
|
|
18
18
|
rebaseChange,
|
|
19
19
|
type RebaseStatsWithDuration,
|
|
20
|
+
tagChange,
|
|
20
21
|
} from "../core/index.js";
|
|
21
22
|
import { type Mutable, brand, fail, getOrCreate, mapIterable } from "../util/index.js";
|
|
22
23
|
|
|
@@ -642,7 +643,7 @@ export class EditManager<
|
|
|
642
643
|
...newChangeFullyRebased.telemetryProperties,
|
|
643
644
|
});
|
|
644
645
|
|
|
645
|
-
peerLocalBranch.apply(newCommit.change, newCommit.revision);
|
|
646
|
+
peerLocalBranch.apply(tagChange(newCommit.change, newCommit.revision));
|
|
646
647
|
this.pushCommitToTrunk(sequenceId, {
|
|
647
648
|
...newCommit,
|
|
648
649
|
change: newChangeFullyRebased.change,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
RevisionTagCodec,
|
|
33
33
|
type SchemaAndPolicy,
|
|
34
34
|
type SchemaPolicy,
|
|
35
|
+
type TaggedChange,
|
|
35
36
|
type TreeStoredSchemaRepository,
|
|
36
37
|
} from "../core/index.js";
|
|
37
38
|
import {
|
|
@@ -271,7 +272,8 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
271
272
|
this.resubmitMachine =
|
|
272
273
|
resubmitMachine ??
|
|
273
274
|
new DefaultResubmitMachine(
|
|
274
|
-
|
|
275
|
+
(change: TaggedChange<TChange>) =>
|
|
276
|
+
changeFamily.rebaser.invert(change, true, this.mintRevisionTag()),
|
|
275
277
|
changeEnricher,
|
|
276
278
|
);
|
|
277
279
|
this.commitEnricher = new BranchCommitEnricher(changeFamily.rebaser, changeEnricher);
|
|
@@ -446,7 +448,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
446
448
|
const {
|
|
447
449
|
commit: { revision, change },
|
|
448
450
|
} = this.messageCodec.decode(content, { idCompressor: this.idCompressor });
|
|
449
|
-
this.editManager.localBranch.apply(change, revision);
|
|
451
|
+
this.editManager.localBranch.apply({ change, revision });
|
|
450
452
|
}
|
|
451
453
|
|
|
452
454
|
public override getGCData(fullGC?: boolean): IGarbageCollectionData {
|