@fluidframework/tree 2.116.0 → 2.117.0
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/CHANGELOG.md +116 -0
- package/api-report/tree.alpha.api.md +78 -30
- package/api-report/tree.beta.api.md +12 -9
- package/api-report/tree.legacy.beta.api.md +12 -9
- package/dist/codec/codec.d.ts +18 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +18 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +39 -2
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +37 -2
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +1 -0
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/revertible.d.ts +62 -6
- package/dist/core/revertible.d.ts.map +1 -1
- package/dist/core/revertible.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/feature-libraries/indexing/types.d.ts +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.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/history.d.ts +22 -0
- package/dist/shared-tree/history.d.ts.map +1 -0
- package/dist/shared-tree/history.js +66 -0
- package/dist/shared-tree/history.js.map +1 -0
- package/dist/shared-tree/schematizingTreeView.d.ts +12 -7
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +13 -0
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -0
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +8 -20
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +9 -12
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +16 -9
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +130 -33
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -0
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +16 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +20 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/dist/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/dist/shared-tree-core/branchCommitCounter.js +79 -0
- package/dist/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.js +37 -0
- package/dist/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.js +15 -0
- package/dist/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +15 -3
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +5 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +5 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +6 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +4 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +9 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +26 -4
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +28 -2
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +180 -61
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/tableSchema.js +10 -10
- package/dist/tableSchema.js.map +1 -1
- package/lib/codec/codec.d.ts +18 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +18 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +39 -2
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +35 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +1 -0
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/revertible.d.ts +62 -6
- package/lib/core/revertible.d.ts.map +1 -1
- package/lib/core/revertible.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/feature-libraries/indexing/types.d.ts +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.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/history.d.ts +22 -0
- package/lib/shared-tree/history.d.ts.map +1 -0
- package/lib/shared-tree/history.js +62 -0
- package/lib/shared-tree/history.js.map +1 -0
- package/lib/shared-tree/schematizingTreeView.d.ts +12 -7
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +13 -0
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -0
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +8 -20
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +9 -12
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +16 -9
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +131 -34
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +3 -0
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +16 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +20 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/lib/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/lib/shared-tree-core/branchCommitCounter.js +75 -0
- package/lib/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.js +32 -0
- package/lib/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.js +11 -0
- package/lib/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +16 -4
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +5 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -0
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +5 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +6 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +5 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +9 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +27 -5
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +28 -2
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +180 -61
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/tableSchema.js +10 -10
- package/lib/tableSchema.js.map +1 -1
- package/package.json +23 -23
- package/src/codec/codec.ts +19 -0
- package/src/core/index.ts +4 -0
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +72 -2
- package/src/core/rebase/utils.ts +1 -0
- package/src/core/revertible.ts +67 -6
- package/src/entrypoints/alpha.ts +8 -0
- package/src/entrypoints/beta.ts +1 -0
- package/src/entrypoints/legacy.ts +1 -0
- package/src/feature-libraries/indexing/types.ts +1 -1
- package/src/index.ts +8 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +99 -0
- package/src/shared-tree/schematizingTreeView.ts +25 -8
- package/src/shared-tree/sharedTree.ts +5 -2
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +17 -35
- package/src/shared-tree/treeCheckout.ts +178 -39
- package/src/shared-tree/unhydratedTreeContext.ts +6 -2
- package/src/shared-tree-core/branch.ts +34 -2
- package/src/shared-tree-core/branchCommitCounter.ts +103 -0
- package/src/shared-tree-core/customMetadataCodec.ts +42 -0
- package/src/shared-tree-core/customMetadataFormat.ts +39 -0
- package/src/shared-tree-core/editManager.ts +22 -3
- package/src/shared-tree-core/editManagerCodecs.ts +12 -0
- package/src/shared-tree-core/editManagerCodecsCommons.ts +41 -15
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +7 -1
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -0
- package/src/shared-tree-core/editManagerFormatCommons.ts +46 -12
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +13 -5
- package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -2
- package/src/shared-tree-core/index.ts +3 -0
- package/src/shared-tree-core/messageCodecV1ToV4.ts +18 -5
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +9 -2
- package/src/shared-tree-core/messageCodecs.ts +12 -0
- package/src/shared-tree-core/messageFormat.ts +6 -0
- package/src/shared-tree-core/messageFormatV1ToV4.ts +21 -3
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +8 -0
- package/src/shared-tree-core/sharedTreeCore.ts +5 -2
- package/src/shared-tree-core/transaction.ts +56 -4
- package/src/simple-tree/api/index.ts +5 -0
- package/src/simple-tree/api/transactionTypes.ts +29 -2
- package/src/simple-tree/api/tree.ts +199 -60
- package/src/simple-tree/index.ts +5 -0
- package/src/tableSchema.ts +9 -9
|
@@ -7,16 +7,50 @@ import { createEmitter } from "@fluid-internal/client-utils";
|
|
|
7
7
|
import { assert, unreachableCase, fail } from "@fluidframework/core-utils/internal";
|
|
8
8
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
9
9
|
import { FluidClientVersion, FormatValidatorNoOp, } from "../codec/index.js";
|
|
10
|
-
import { CommitKind, CommitOutcome, RevertibleStatus, TreeStoredSchemaRepository, combineVisitors, makeDetachedFieldIndex, rebaseChange, rootFieldKey, tagChange, visitDelta, isAncestor, moveToDetachedField, LeafNodeStoredSchema, diffHistories, makeAnonChange, deltaFieldMapHasVisibleChanges, findCommonAncestor, rebaseBranch, } from "../core/index.js";
|
|
10
|
+
import { CommitKind, CommitOutcome, RevertibleStatus, TreeStoredSchemaRepository, combineVisitors, makeDetachedFieldIndex, rebaseChange, rootFieldKey, tagChange, visitDelta, isAncestor, moveToDetachedField, LeafNodeStoredSchema, diffHistories, makeAnonChange, deltaFieldMapHasVisibleChanges, findCommonAncestor, rebaseBranch, findAncestor, } from "../core/index.js";
|
|
11
11
|
import { allowsRepoSuperset, buildForest, createNodeIdentifierManager, defaultSchemaPolicy, fieldBatchCodecBuilder, TreeStatus, intoDelta, jsonableTreeFromCursor, } from "../feature-libraries/index.js";
|
|
12
12
|
import { SquashingTransactionStack, SharedTreeBranch, TransactionResult as InternalTransactionResult, } from "../shared-tree-core/index.js";
|
|
13
13
|
import { getInnerNode, getKernel, customFromCursorStored, } from "../simple-tree/index.js";
|
|
14
14
|
import { Breakable, breakingMethod, disposeSymbol, getOrCreate, hasSome, throwIfBroken, } from "../util/index.js";
|
|
15
15
|
import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
16
|
+
import { DefaultTreeBranchHistory } from "./history.js";
|
|
16
17
|
import { SharedTreeChangeEnricher } from "./sharedTreeChangeEnricher.js";
|
|
17
18
|
import { ConstraintStatus, SharedTreeChangeFamily, getConstraintStatus, hasSchemaChange, } from "./sharedTreeChangeFamily.js";
|
|
18
19
|
import { extractTransactionChangeProcessor } from "./transactionPostProcessor.js";
|
|
19
20
|
import { SerializedChange } from "./serializedChange.js";
|
|
21
|
+
/**
|
|
22
|
+
* Returns a defensive copy of the given metadata, validating that it can be persisted.
|
|
23
|
+
* @remarks
|
|
24
|
+
* The round-trip through JSON ensures that the value read back locally is exactly the value that peers and
|
|
25
|
+
* future summaries will see, and that later mutation of the caller's object cannot affect an existing commit.
|
|
26
|
+
* @throws A `UsageError` if the value cannot be represented as a JSON object.
|
|
27
|
+
*/
|
|
28
|
+
function snapshotCustomMetadata(customMetadata) {
|
|
29
|
+
if (customMetadata === undefined) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
let serialized;
|
|
33
|
+
try {
|
|
34
|
+
serialized = JSON.stringify(customMetadata);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new UsageError(`"customMetadata" must be JSON-serializable: ${error instanceof Error ? error.message : String(error)}`);
|
|
38
|
+
}
|
|
39
|
+
if (serialized === undefined) {
|
|
40
|
+
throw new UsageError(`"customMetadata" must be JSON-serializable.`);
|
|
41
|
+
}
|
|
42
|
+
const snapshot = JSON.parse(serialized);
|
|
43
|
+
if (typeof snapshot !== "object" || snapshot === null || Array.isArray(snapshot)) {
|
|
44
|
+
throw new UsageError(`"customMetadata" must be a JSON object.`);
|
|
45
|
+
}
|
|
46
|
+
return snapshot;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Wraps metadata for an operation which produces a single commit.
|
|
50
|
+
*/
|
|
51
|
+
function toMetadataTree(customMetadata) {
|
|
52
|
+
return customMetadata === undefined ? undefined : { metadata: customMetadata, children: [] };
|
|
53
|
+
}
|
|
20
54
|
/**
|
|
21
55
|
* Yields all defined (non-`undefined`) labels from a {@link LabelTree}, depth-first.
|
|
22
56
|
*/
|
|
@@ -81,11 +115,12 @@ export function createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCod
|
|
|
81
115
|
new SharedTreeBranch({
|
|
82
116
|
change: changeFamily.rebaser.compose([]),
|
|
83
117
|
revision: "root",
|
|
118
|
+
customMetadata: undefined,
|
|
84
119
|
}, changeFamily, () => idCompressor.generateCompressedId());
|
|
85
120
|
return new TreeCheckout(branch, true, changeFamily, schema, forest, mintRevisionTag, revisionTagCodec, idCompressor, args?.removedRoots);
|
|
86
121
|
}
|
|
87
122
|
/**
|
|
88
|
-
* Get the {@link TreeCheckout} associated with a given {@link
|
|
123
|
+
* Get the {@link TreeCheckout} associated with a given {@link UntypedTreeView}.
|
|
89
124
|
*/
|
|
90
125
|
function getCheckout(context) {
|
|
91
126
|
if (context instanceof TreeCheckout) {
|
|
@@ -199,7 +234,8 @@ let TreeCheckout = (() => {
|
|
|
199
234
|
constructor(branch,
|
|
200
235
|
/** True if and only if this checkout is for a branch which is persisted and shared with other clients. */
|
|
201
236
|
isSharedBranch, changeFamily, storedSchema, forest, mintRevisionTag, revisionTagCodec, idCompressor, _removedRoots = makeDetachedFieldIndex("repair"), disposeForksAfterTransaction = true) {
|
|
202
|
-
this.
|
|
237
|
+
this.branch = (__runInitializers(this, _instanceExtraInitializers), branch);
|
|
238
|
+
this.isSharedBranch = isSharedBranch;
|
|
203
239
|
this.changeFamily = changeFamily;
|
|
204
240
|
this.storedSchema = storedSchema;
|
|
205
241
|
this.forest = forest;
|
|
@@ -281,7 +317,7 @@ let TreeCheckout = (() => {
|
|
|
281
317
|
throw new UsageError("Cannot generate the same revertible more than once. Note that this can happen when multiple changed event listeners are registered.");
|
|
282
318
|
}
|
|
283
319
|
const revertible = this.createRevertible(revision, kind, this, onRevertibleDisposed, commitLabelTree);
|
|
284
|
-
this.revertibleCommitBranches.set(revision, __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
320
|
+
this.revertibleCommitBranches.set(revision, __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.fork(commit));
|
|
285
321
|
this.revertibles.set(revision, revertible);
|
|
286
322
|
return revertible;
|
|
287
323
|
};
|
|
@@ -381,6 +417,10 @@ let TreeCheckout = (() => {
|
|
|
381
417
|
this.editLock = new EditLock(__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").activeBranchEditor);
|
|
382
418
|
this.registerForBranchEvents();
|
|
383
419
|
}
|
|
420
|
+
get branchHistory() {
|
|
421
|
+
this._branchHistory ??= new DefaultTreeBranchHistory(this.branch, this.idCompressor);
|
|
422
|
+
return this._branchHistory;
|
|
423
|
+
}
|
|
384
424
|
/**
|
|
385
425
|
* Pushes a new label node for a transaction nesting level.
|
|
386
426
|
*
|
|
@@ -579,13 +619,16 @@ let TreeCheckout = (() => {
|
|
|
579
619
|
applySerializedChange(serializedChange) {
|
|
580
620
|
const change = SerializedChange.V1.decode(this.idCompressor, this.changeFamily, serializedChange);
|
|
581
621
|
// Apply the change to the branch, but _not_ the `activeBranch` - we do not support squashing serialized commits in a transaction.
|
|
582
|
-
__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply(change);
|
|
622
|
+
__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply(change, CommitKind.Default, undefined);
|
|
583
623
|
}
|
|
584
|
-
// #region
|
|
624
|
+
// #region UntypedTreeViewAlpha
|
|
585
625
|
applyChange(change) {
|
|
586
626
|
this.applySerializedChange(change);
|
|
587
627
|
}
|
|
588
628
|
isBranch() {
|
|
629
|
+
return this.isView();
|
|
630
|
+
}
|
|
631
|
+
isView() {
|
|
589
632
|
return true;
|
|
590
633
|
}
|
|
591
634
|
hasRootSchema(_schema) {
|
|
@@ -618,6 +661,9 @@ let TreeCheckout = (() => {
|
|
|
618
661
|
this.pushLabelFrame(params?.label);
|
|
619
662
|
this.transaction.start({
|
|
620
663
|
postProcessor: extractTransactionChangeProcessor(params?.postProcessor),
|
|
664
|
+
// Like the validation described above, rejecting malformed metadata breaks the checkout rather
|
|
665
|
+
// than being recoverable. Tracked by https://github.com/microsoft/FluidFramework/issues/28085.
|
|
666
|
+
customMetadata: snapshotCustomMetadata(params?.customMetadata),
|
|
621
667
|
});
|
|
622
668
|
addConstraintsToTransaction(this, false, params?.preconditions);
|
|
623
669
|
}
|
|
@@ -641,7 +687,7 @@ let TreeCheckout = (() => {
|
|
|
641
687
|
? { success: true }
|
|
642
688
|
: { success: true, value: value };
|
|
643
689
|
}
|
|
644
|
-
// #endregion
|
|
690
|
+
// #endregion UntypedTreeViewAlpha
|
|
645
691
|
// Revision is the revision of the commit, if any, which caused this change.
|
|
646
692
|
applyInternalChange(change, revision) {
|
|
647
693
|
// Conflicts due to schema will be empty and thus are not applied.
|
|
@@ -711,29 +757,32 @@ let TreeCheckout = (() => {
|
|
|
711
757
|
? RevertibleStatus.Disposed
|
|
712
758
|
: RevertibleStatus.Valid;
|
|
713
759
|
},
|
|
714
|
-
revert: (
|
|
760
|
+
revert: (releaseOrOptions = true) => {
|
|
715
761
|
if (revertible.status === RevertibleStatus.Disposed) {
|
|
716
762
|
throw new UsageError("Unable to revert a revertible that has been disposed.");
|
|
717
763
|
}
|
|
718
|
-
const
|
|
764
|
+
const options = typeof releaseOrOptions === "boolean"
|
|
765
|
+
? { dispose: releaseOrOptions }
|
|
766
|
+
: releaseOrOptions;
|
|
767
|
+
const revertMetrics = checkout.revertRevertible(revision, kind, labelTree, snapshotCustomMetadata(options.customMetadata));
|
|
719
768
|
checkout.logger?.sendTelemetryEvent({
|
|
720
769
|
eventName: _a.revertTelemetryEventName,
|
|
721
770
|
...revertMetrics,
|
|
722
771
|
});
|
|
723
|
-
if (
|
|
772
|
+
if (options.dispose ?? true) {
|
|
724
773
|
revertible.dispose();
|
|
725
774
|
}
|
|
726
775
|
},
|
|
727
|
-
clone: (
|
|
776
|
+
clone: (targetView) => {
|
|
728
777
|
// TODO:#23442: When a revertible is cloned for a forked branch, optimize to create a fork of a revertible branch once per revision NOT once per revision per checkout.
|
|
729
|
-
const targetCheckout = getCheckout(
|
|
778
|
+
const targetCheckout = getCheckout(targetView);
|
|
730
779
|
const revertibleBranch = this.revertibleCommitBranches.get(revision);
|
|
731
780
|
if (revertibleBranch === undefined) {
|
|
732
781
|
throw new UsageError("Unable to clone a revertible that has been disposed.");
|
|
733
782
|
}
|
|
734
783
|
const commitToRevert = revertibleBranch.getHead();
|
|
735
|
-
const
|
|
736
|
-
if (isAncestor(commitToRevert,
|
|
784
|
+
const branchHead = __classPrivateFieldGet(targetCheckout, _TreeCheckout_transaction, "f").branch.getHead();
|
|
785
|
+
if (isAncestor(commitToRevert, branchHead, true) === false) {
|
|
737
786
|
throw new UsageError("Cannot clone revertible for a commit that is not present on the given branch.");
|
|
738
787
|
}
|
|
739
788
|
targetCheckout.revertibleCommitBranches.set(revision, revertibleBranch.fork());
|
|
@@ -776,7 +825,7 @@ let TreeCheckout = (() => {
|
|
|
776
825
|
if (this.transaction.size > 0) {
|
|
777
826
|
throw new UsageError("A view cannot be forked while it has a pending transaction.");
|
|
778
827
|
}
|
|
779
|
-
const branch = __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
828
|
+
const branch = __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.fork();
|
|
780
829
|
const storedSchema = this.storedSchema.clone();
|
|
781
830
|
const forkBreaker = new Breakable("TreeCheckout", this.logger);
|
|
782
831
|
const forest = this.forest.clone(storedSchema, forkBreaker);
|
|
@@ -785,19 +834,65 @@ let TreeCheckout = (() => {
|
|
|
785
834
|
return checkout;
|
|
786
835
|
}
|
|
787
836
|
switchBranch(branch) {
|
|
788
|
-
// TODO: Dispose old branch, if necessary
|
|
789
837
|
assert(__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").size === 0, 0xc55 /* Cannot switch branches during a transaction */);
|
|
838
|
+
if (this.isSharedBranch) {
|
|
839
|
+
throw new UsageError("Cannot switch a view away from a shared branch. Consider forking first.");
|
|
840
|
+
}
|
|
790
841
|
const diff = diffHistories(this.changeFamily.rebaser, __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), branch.getHead(), this.mintRevisionTag);
|
|
791
842
|
this.unregisterFromBranchEvents();
|
|
792
843
|
__classPrivateFieldSet(this, _TreeCheckout_transaction, this.createTransactionStack(branch), "f");
|
|
844
|
+
this.branch = branch;
|
|
845
|
+
this._branchHistory?.dispose();
|
|
846
|
+
this._branchHistory = undefined;
|
|
793
847
|
this.editLock = new EditLock(__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").activeBranchEditor);
|
|
794
848
|
this.registerForBranchEvents();
|
|
795
849
|
// TODO: Rework eventing
|
|
796
850
|
this.applyInternalChange(diff);
|
|
797
851
|
__classPrivateFieldGet(this, _TreeCheckout_events, "f").emit("afterBatch");
|
|
798
852
|
}
|
|
799
|
-
|
|
800
|
-
|
|
853
|
+
rewindTo(revisionString) {
|
|
854
|
+
this.checkNotDisposed("The branch has already been disposed and cannot be rewound.");
|
|
855
|
+
if (__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").size > 0) {
|
|
856
|
+
throw new UsageError("Rewinding is not supported during transactions.");
|
|
857
|
+
}
|
|
858
|
+
const revision = this.idCompressor.tryRecompress(revisionString);
|
|
859
|
+
if (revision === undefined) {
|
|
860
|
+
throw new UsageError(`Unrecognized revision id: ${revisionString}`);
|
|
861
|
+
}
|
|
862
|
+
const targetCommit = findAncestor(__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), (commit) => commit.revision === revision);
|
|
863
|
+
if (targetCommit === undefined) {
|
|
864
|
+
throw new UsageError(`No commit found with revision: ${revisionString}`);
|
|
865
|
+
}
|
|
866
|
+
this.switchBranch(__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.fork(targetCommit));
|
|
867
|
+
}
|
|
868
|
+
revertTo(revisionString, options) {
|
|
869
|
+
this.checkNotDisposed("The branch has already been disposed and prior revisions cannot be reverted to.");
|
|
870
|
+
this.editLock.checkUnlocked("Reverting to a revision");
|
|
871
|
+
if (__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").size > 0) {
|
|
872
|
+
throw new UsageError("Reverting to a revision is not supported during transactions.");
|
|
873
|
+
}
|
|
874
|
+
const customMetadata = snapshotCustomMetadata(options?.customMetadata);
|
|
875
|
+
const revision = this.idCompressor.tryRecompress(revisionString);
|
|
876
|
+
if (revision === undefined) {
|
|
877
|
+
throw new UsageError(`Unrecognized revision id: ${revisionString}`);
|
|
878
|
+
}
|
|
879
|
+
// Populated with the commits that came after the target commit, from oldest to newest.
|
|
880
|
+
const commitsToUndo = [];
|
|
881
|
+
const targetCommit = findAncestor([__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").activeBranch.getHead(), commitsToUndo], (commit) => commit.revision === revision);
|
|
882
|
+
if (targetCommit === undefined) {
|
|
883
|
+
throw new UsageError(`No commit found with revision: ${revisionString}`);
|
|
884
|
+
}
|
|
885
|
+
if (!hasSome(commitsToUndo)) {
|
|
886
|
+
// The target commit is already the head of the branch, so there is nothing to revert.
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
const revisionForInvert = this.mintRevisionTag();
|
|
890
|
+
const toUndo = this.changeFamily.rebaser.compose(commitsToUndo);
|
|
891
|
+
const inverse = this.changeFamily.rebaser.invert(makeAnonChange(toUndo), false, revisionForInvert);
|
|
892
|
+
__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply(tagChange(inverse, revisionForInvert), CommitKind.Default, toMetadataTree(customMetadata));
|
|
893
|
+
}
|
|
894
|
+
rebase(view) {
|
|
895
|
+
const checkout = getCheckout(view);
|
|
801
896
|
this.checkNotDisposed("The target branch of the rebase has been disposed and cannot be rebased.");
|
|
802
897
|
checkout.checkNotDisposed("The source branch of the rebase has been disposed and cannot be rebased.");
|
|
803
898
|
this.editLock.checkUnlocked("Rebasing");
|
|
@@ -808,16 +903,16 @@ let TreeCheckout = (() => {
|
|
|
808
903
|
throw new UsageError("A view cannot be rebased while it has a pending transaction.");
|
|
809
904
|
}
|
|
810
905
|
assert(!checkout.isSharedBranch, 0xa5d /* Shared branches cannot be rebased onto another branch. */);
|
|
811
|
-
__classPrivateFieldGet(checkout, _TreeCheckout_transaction, "f").
|
|
906
|
+
__classPrivateFieldGet(checkout, _TreeCheckout_transaction, "f").branch.rebaseOnto(__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch);
|
|
812
907
|
}
|
|
813
|
-
rebaseOnto(
|
|
814
|
-
getCheckout(
|
|
908
|
+
rebaseOnto(view) {
|
|
909
|
+
getCheckout(view).rebase(this);
|
|
815
910
|
}
|
|
816
|
-
isMissingEditsFrom(
|
|
817
|
-
const
|
|
911
|
+
isMissingEditsFrom(view) {
|
|
912
|
+
const viewCheckout = getCheckout(view);
|
|
818
913
|
const targetPath = [];
|
|
819
914
|
const ancestor = findCommonAncestor(this.mainBranch.getHead(), [
|
|
820
|
-
|
|
915
|
+
viewCheckout.mainBranch.getHead(),
|
|
821
916
|
targetPath,
|
|
822
917
|
]);
|
|
823
918
|
if (ancestor === undefined) {
|
|
@@ -825,17 +920,17 @@ let TreeCheckout = (() => {
|
|
|
825
920
|
}
|
|
826
921
|
return targetPath.length > 0;
|
|
827
922
|
}
|
|
828
|
-
computeNetChangeIfRebasedOnto(
|
|
829
|
-
const
|
|
830
|
-
const rebased = rebaseBranch(this.mintRevisionTag, this.changeFamily.rebaser, __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), __classPrivateFieldGet(
|
|
923
|
+
computeNetChangeIfRebasedOnto(view) {
|
|
924
|
+
const viewCheckout = getCheckout(view);
|
|
925
|
+
const rebased = rebaseBranch(this.mintRevisionTag, this.changeFamily.rebaser, __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), __classPrivateFieldGet(viewCheckout, _TreeCheckout_transaction, "f").branch.getHead());
|
|
831
926
|
if (rebased.sourceChange === undefined) {
|
|
832
927
|
return undefined;
|
|
833
928
|
}
|
|
834
929
|
const revision = this.mintRevisionTag();
|
|
835
930
|
return SerializedChange.V1.encode(this.idCompressor, this.changeFamily, rebased.sourceChange, revision, undefined);
|
|
836
931
|
}
|
|
837
|
-
merge(
|
|
838
|
-
const checkout = getCheckout(
|
|
932
|
+
merge(view, disposeMerged = true) {
|
|
933
|
+
const checkout = getCheckout(view);
|
|
839
934
|
this.checkNotDisposed("The target branch of the merge has been disposed and cannot be merged.");
|
|
840
935
|
checkout.checkNotDisposed("The source branch of the merge has been disposed and cannot be merged.");
|
|
841
936
|
this.editLock.checkUnlocked("Merging");
|
|
@@ -845,7 +940,7 @@ let TreeCheckout = (() => {
|
|
|
845
940
|
if (checkout.transaction.size > 0) {
|
|
846
941
|
throw new UsageError("Views with an open transaction cannot be merged into another view.");
|
|
847
942
|
}
|
|
848
|
-
__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
943
|
+
__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.merge(__classPrivateFieldGet(checkout, _TreeCheckout_transaction, "f").branch);
|
|
849
944
|
if (disposeMerged && !checkout.isSharedBranch) {
|
|
850
945
|
// Dispose the merged checkout unless it is a shared branch.
|
|
851
946
|
checkout[disposeSymbol]();
|
|
@@ -872,6 +967,8 @@ let TreeCheckout = (() => {
|
|
|
872
967
|
view.dispose();
|
|
873
968
|
}
|
|
874
969
|
__classPrivateFieldGet(this, _TreeCheckout_events, "f").emit("dispose");
|
|
970
|
+
this._branchHistory?.dispose();
|
|
971
|
+
this._branchHistory = undefined;
|
|
875
972
|
}
|
|
876
973
|
getRemovedRoots() {
|
|
877
974
|
this.assertNoUntrackedRoots();
|
|
@@ -911,7 +1008,7 @@ let TreeCheckout = (() => {
|
|
|
911
1008
|
this.revertibleCommitBranches.delete(revision);
|
|
912
1009
|
this.revertibles.delete(revision);
|
|
913
1010
|
}
|
|
914
|
-
revertRevertible(revision, kind, labelTree) {
|
|
1011
|
+
revertRevertible(revision, kind, labelTree, customMetadata) {
|
|
915
1012
|
this.editLock.checkUnlocked("Reverting a commit");
|
|
916
1013
|
if (this.transaction.size > 0) {
|
|
917
1014
|
throw new UsageError("Undo is not yet supported during transactions.");
|
|
@@ -921,7 +1018,7 @@ let TreeCheckout = (() => {
|
|
|
921
1018
|
const commitToRevert = revertibleBranch.getHead();
|
|
922
1019
|
const revisionForInvert = this.mintRevisionTag();
|
|
923
1020
|
let change = tagChange(this.changeFamily.rebaser.invert(commitToRevert, false, revisionForInvert), revisionForInvert);
|
|
924
|
-
const headCommit = __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
1021
|
+
const headCommit = __classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead();
|
|
925
1022
|
// Rebase the inverted change onto any commits that occurred after the undoable commits.
|
|
926
1023
|
if (commitToRevert !== headCommit) {
|
|
927
1024
|
// The inverse may be rebased over newer commits which (despite being present in the history)
|
|
@@ -937,9 +1034,9 @@ let TreeCheckout = (() => {
|
|
|
937
1034
|
const previousLabelTreeNode = this.labelTreeNode;
|
|
938
1035
|
this.labelTreeNode = labelTree;
|
|
939
1036
|
try {
|
|
940
|
-
__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
1037
|
+
__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply(change, kind === CommitKind.Default || kind === CommitKind.Redo
|
|
941
1038
|
? CommitKind.Undo
|
|
942
|
-
: CommitKind.Redo);
|
|
1039
|
+
: CommitKind.Redo, toMetadataTree(customMetadata));
|
|
943
1040
|
}
|
|
944
1041
|
finally {
|
|
945
1042
|
this.labelTreeNode = previousLabelTreeNode;
|