@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
|
@@ -16,10 +16,44 @@ const index_js_4 = require("../shared-tree-core/index.js");
|
|
|
16
16
|
const index_js_5 = require("../simple-tree/index.js");
|
|
17
17
|
const index_js_6 = require("../util/index.js");
|
|
18
18
|
const schematizingTreeView_js_1 = require("./schematizingTreeView.js");
|
|
19
|
+
const history_js_1 = require("./history.js");
|
|
19
20
|
const sharedTreeChangeEnricher_js_1 = require("./sharedTreeChangeEnricher.js");
|
|
20
21
|
const sharedTreeChangeFamily_js_1 = require("./sharedTreeChangeFamily.js");
|
|
21
22
|
const transactionPostProcessor_js_1 = require("./transactionPostProcessor.js");
|
|
22
23
|
const serializedChange_js_1 = require("./serializedChange.js");
|
|
24
|
+
/**
|
|
25
|
+
* Returns a defensive copy of the given metadata, validating that it can be persisted.
|
|
26
|
+
* @remarks
|
|
27
|
+
* The round-trip through JSON ensures that the value read back locally is exactly the value that peers and
|
|
28
|
+
* future summaries will see, and that later mutation of the caller's object cannot affect an existing commit.
|
|
29
|
+
* @throws A `UsageError` if the value cannot be represented as a JSON object.
|
|
30
|
+
*/
|
|
31
|
+
function snapshotCustomMetadata(customMetadata) {
|
|
32
|
+
if (customMetadata === undefined) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
let serialized;
|
|
36
|
+
try {
|
|
37
|
+
serialized = JSON.stringify(customMetadata);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new internal_2.UsageError(`"customMetadata" must be JSON-serializable: ${error instanceof Error ? error.message : String(error)}`);
|
|
41
|
+
}
|
|
42
|
+
if (serialized === undefined) {
|
|
43
|
+
throw new internal_2.UsageError(`"customMetadata" must be JSON-serializable.`);
|
|
44
|
+
}
|
|
45
|
+
const snapshot = JSON.parse(serialized);
|
|
46
|
+
if (typeof snapshot !== "object" || snapshot === null || Array.isArray(snapshot)) {
|
|
47
|
+
throw new internal_2.UsageError(`"customMetadata" must be a JSON object.`);
|
|
48
|
+
}
|
|
49
|
+
return snapshot;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Wraps metadata for an operation which produces a single commit.
|
|
53
|
+
*/
|
|
54
|
+
function toMetadataTree(customMetadata) {
|
|
55
|
+
return customMetadata === undefined ? undefined : { metadata: customMetadata, children: [] };
|
|
56
|
+
}
|
|
23
57
|
/**
|
|
24
58
|
* Yields all defined (non-`undefined`) labels from a {@link LabelTree}, depth-first.
|
|
25
59
|
*/
|
|
@@ -84,12 +118,13 @@ function createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, arg
|
|
|
84
118
|
new index_js_4.SharedTreeBranch({
|
|
85
119
|
change: changeFamily.rebaser.compose([]),
|
|
86
120
|
revision: "root",
|
|
121
|
+
customMetadata: undefined,
|
|
87
122
|
}, changeFamily, () => idCompressor.generateCompressedId());
|
|
88
123
|
return new TreeCheckout(branch, true, changeFamily, schema, forest, mintRevisionTag, revisionTagCodec, idCompressor, args?.removedRoots);
|
|
89
124
|
}
|
|
90
125
|
exports.createTreeCheckout = createTreeCheckout;
|
|
91
126
|
/**
|
|
92
|
-
* Get the {@link TreeCheckout} associated with a given {@link
|
|
127
|
+
* Get the {@link TreeCheckout} associated with a given {@link UntypedTreeView}.
|
|
93
128
|
*/
|
|
94
129
|
function getCheckout(context) {
|
|
95
130
|
if (context instanceof TreeCheckout) {
|
|
@@ -205,7 +240,8 @@ let TreeCheckout = (() => {
|
|
|
205
240
|
constructor(branch,
|
|
206
241
|
/** True if and only if this checkout is for a branch which is persisted and shared with other clients. */
|
|
207
242
|
isSharedBranch, changeFamily, storedSchema, forest, mintRevisionTag, revisionTagCodec, idCompressor, _removedRoots = (0, index_js_2.makeDetachedFieldIndex)("repair"), disposeForksAfterTransaction = true) {
|
|
208
|
-
this.
|
|
243
|
+
this.branch = (tslib_1.__runInitializers(this, _instanceExtraInitializers), branch);
|
|
244
|
+
this.isSharedBranch = isSharedBranch;
|
|
209
245
|
this.changeFamily = changeFamily;
|
|
210
246
|
this.storedSchema = storedSchema;
|
|
211
247
|
this.forest = forest;
|
|
@@ -287,7 +323,7 @@ let TreeCheckout = (() => {
|
|
|
287
323
|
throw new internal_2.UsageError("Cannot generate the same revertible more than once. Note that this can happen when multiple changed event listeners are registered.");
|
|
288
324
|
}
|
|
289
325
|
const revertible = this.createRevertible(revision, kind, this, onRevertibleDisposed, commitLabelTree);
|
|
290
|
-
this.revertibleCommitBranches.set(revision, tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
326
|
+
this.revertibleCommitBranches.set(revision, tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.fork(commit));
|
|
291
327
|
this.revertibles.set(revision, revertible);
|
|
292
328
|
return revertible;
|
|
293
329
|
};
|
|
@@ -387,6 +423,10 @@ let TreeCheckout = (() => {
|
|
|
387
423
|
this.editLock = new EditLock(tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").activeBranchEditor);
|
|
388
424
|
this.registerForBranchEvents();
|
|
389
425
|
}
|
|
426
|
+
get branchHistory() {
|
|
427
|
+
this._branchHistory ??= new history_js_1.DefaultTreeBranchHistory(this.branch, this.idCompressor);
|
|
428
|
+
return this._branchHistory;
|
|
429
|
+
}
|
|
390
430
|
/**
|
|
391
431
|
* Pushes a new label node for a transaction nesting level.
|
|
392
432
|
*
|
|
@@ -585,13 +625,16 @@ let TreeCheckout = (() => {
|
|
|
585
625
|
applySerializedChange(serializedChange) {
|
|
586
626
|
const change = serializedChange_js_1.SerializedChange.V1.decode(this.idCompressor, this.changeFamily, serializedChange);
|
|
587
627
|
// Apply the change to the branch, but _not_ the `activeBranch` - we do not support squashing serialized commits in a transaction.
|
|
588
|
-
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply(change);
|
|
628
|
+
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply(change, index_js_2.CommitKind.Default, undefined);
|
|
589
629
|
}
|
|
590
|
-
// #region
|
|
630
|
+
// #region UntypedTreeViewAlpha
|
|
591
631
|
applyChange(change) {
|
|
592
632
|
this.applySerializedChange(change);
|
|
593
633
|
}
|
|
594
634
|
isBranch() {
|
|
635
|
+
return this.isView();
|
|
636
|
+
}
|
|
637
|
+
isView() {
|
|
595
638
|
return true;
|
|
596
639
|
}
|
|
597
640
|
hasRootSchema(_schema) {
|
|
@@ -624,6 +667,9 @@ let TreeCheckout = (() => {
|
|
|
624
667
|
this.pushLabelFrame(params?.label);
|
|
625
668
|
this.transaction.start({
|
|
626
669
|
postProcessor: (0, transactionPostProcessor_js_1.extractTransactionChangeProcessor)(params?.postProcessor),
|
|
670
|
+
// Like the validation described above, rejecting malformed metadata breaks the checkout rather
|
|
671
|
+
// than being recoverable. Tracked by https://github.com/microsoft/FluidFramework/issues/28085.
|
|
672
|
+
customMetadata: snapshotCustomMetadata(params?.customMetadata),
|
|
627
673
|
});
|
|
628
674
|
addConstraintsToTransaction(this, false, params?.preconditions);
|
|
629
675
|
}
|
|
@@ -647,7 +693,7 @@ let TreeCheckout = (() => {
|
|
|
647
693
|
? { success: true }
|
|
648
694
|
: { success: true, value: value };
|
|
649
695
|
}
|
|
650
|
-
// #endregion
|
|
696
|
+
// #endregion UntypedTreeViewAlpha
|
|
651
697
|
// Revision is the revision of the commit, if any, which caused this change.
|
|
652
698
|
applyInternalChange(change, revision) {
|
|
653
699
|
// Conflicts due to schema will be empty and thus are not applied.
|
|
@@ -717,29 +763,32 @@ let TreeCheckout = (() => {
|
|
|
717
763
|
? index_js_2.RevertibleStatus.Disposed
|
|
718
764
|
: index_js_2.RevertibleStatus.Valid;
|
|
719
765
|
},
|
|
720
|
-
revert: (
|
|
766
|
+
revert: (releaseOrOptions = true) => {
|
|
721
767
|
if (revertible.status === index_js_2.RevertibleStatus.Disposed) {
|
|
722
768
|
throw new internal_2.UsageError("Unable to revert a revertible that has been disposed.");
|
|
723
769
|
}
|
|
724
|
-
const
|
|
770
|
+
const options = typeof releaseOrOptions === "boolean"
|
|
771
|
+
? { dispose: releaseOrOptions }
|
|
772
|
+
: releaseOrOptions;
|
|
773
|
+
const revertMetrics = checkout.revertRevertible(revision, kind, labelTree, snapshotCustomMetadata(options.customMetadata));
|
|
725
774
|
checkout.logger?.sendTelemetryEvent({
|
|
726
775
|
eventName: _a.revertTelemetryEventName,
|
|
727
776
|
...revertMetrics,
|
|
728
777
|
});
|
|
729
|
-
if (
|
|
778
|
+
if (options.dispose ?? true) {
|
|
730
779
|
revertible.dispose();
|
|
731
780
|
}
|
|
732
781
|
},
|
|
733
|
-
clone: (
|
|
782
|
+
clone: (targetView) => {
|
|
734
783
|
// 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.
|
|
735
|
-
const targetCheckout = getCheckout(
|
|
784
|
+
const targetCheckout = getCheckout(targetView);
|
|
736
785
|
const revertibleBranch = this.revertibleCommitBranches.get(revision);
|
|
737
786
|
if (revertibleBranch === undefined) {
|
|
738
787
|
throw new internal_2.UsageError("Unable to clone a revertible that has been disposed.");
|
|
739
788
|
}
|
|
740
789
|
const commitToRevert = revertibleBranch.getHead();
|
|
741
|
-
const
|
|
742
|
-
if ((0, index_js_2.isAncestor)(commitToRevert,
|
|
790
|
+
const branchHead = tslib_1.__classPrivateFieldGet(targetCheckout, _TreeCheckout_transaction, "f").branch.getHead();
|
|
791
|
+
if ((0, index_js_2.isAncestor)(commitToRevert, branchHead, true) === false) {
|
|
743
792
|
throw new internal_2.UsageError("Cannot clone revertible for a commit that is not present on the given branch.");
|
|
744
793
|
}
|
|
745
794
|
targetCheckout.revertibleCommitBranches.set(revision, revertibleBranch.fork());
|
|
@@ -782,7 +831,7 @@ let TreeCheckout = (() => {
|
|
|
782
831
|
if (this.transaction.size > 0) {
|
|
783
832
|
throw new internal_2.UsageError("A view cannot be forked while it has a pending transaction.");
|
|
784
833
|
}
|
|
785
|
-
const branch = tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
834
|
+
const branch = tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.fork();
|
|
786
835
|
const storedSchema = this.storedSchema.clone();
|
|
787
836
|
const forkBreaker = new index_js_6.Breakable("TreeCheckout", this.logger);
|
|
788
837
|
const forest = this.forest.clone(storedSchema, forkBreaker);
|
|
@@ -791,19 +840,65 @@ let TreeCheckout = (() => {
|
|
|
791
840
|
return checkout;
|
|
792
841
|
}
|
|
793
842
|
switchBranch(branch) {
|
|
794
|
-
// TODO: Dispose old branch, if necessary
|
|
795
843
|
(0, internal_1.assert)(tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").size === 0, 0xc55 /* Cannot switch branches during a transaction */);
|
|
844
|
+
if (this.isSharedBranch) {
|
|
845
|
+
throw new internal_2.UsageError("Cannot switch a view away from a shared branch. Consider forking first.");
|
|
846
|
+
}
|
|
796
847
|
const diff = (0, index_js_2.diffHistories)(this.changeFamily.rebaser, tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), branch.getHead(), this.mintRevisionTag);
|
|
797
848
|
this.unregisterFromBranchEvents();
|
|
798
849
|
tslib_1.__classPrivateFieldSet(this, _TreeCheckout_transaction, this.createTransactionStack(branch), "f");
|
|
850
|
+
this.branch = branch;
|
|
851
|
+
this._branchHistory?.dispose();
|
|
852
|
+
this._branchHistory = undefined;
|
|
799
853
|
this.editLock = new EditLock(tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").activeBranchEditor);
|
|
800
854
|
this.registerForBranchEvents();
|
|
801
855
|
// TODO: Rework eventing
|
|
802
856
|
this.applyInternalChange(diff);
|
|
803
857
|
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_events, "f").emit("afterBatch");
|
|
804
858
|
}
|
|
805
|
-
|
|
806
|
-
|
|
859
|
+
rewindTo(revisionString) {
|
|
860
|
+
this.checkNotDisposed("The branch has already been disposed and cannot be rewound.");
|
|
861
|
+
if (tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").size > 0) {
|
|
862
|
+
throw new internal_2.UsageError("Rewinding is not supported during transactions.");
|
|
863
|
+
}
|
|
864
|
+
const revision = this.idCompressor.tryRecompress(revisionString);
|
|
865
|
+
if (revision === undefined) {
|
|
866
|
+
throw new internal_2.UsageError(`Unrecognized revision id: ${revisionString}`);
|
|
867
|
+
}
|
|
868
|
+
const targetCommit = (0, index_js_2.findAncestor)(tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), (commit) => commit.revision === revision);
|
|
869
|
+
if (targetCommit === undefined) {
|
|
870
|
+
throw new internal_2.UsageError(`No commit found with revision: ${revisionString}`);
|
|
871
|
+
}
|
|
872
|
+
this.switchBranch(tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.fork(targetCommit));
|
|
873
|
+
}
|
|
874
|
+
revertTo(revisionString, options) {
|
|
875
|
+
this.checkNotDisposed("The branch has already been disposed and prior revisions cannot be reverted to.");
|
|
876
|
+
this.editLock.checkUnlocked("Reverting to a revision");
|
|
877
|
+
if (tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").size > 0) {
|
|
878
|
+
throw new internal_2.UsageError("Reverting to a revision is not supported during transactions.");
|
|
879
|
+
}
|
|
880
|
+
const customMetadata = snapshotCustomMetadata(options?.customMetadata);
|
|
881
|
+
const revision = this.idCompressor.tryRecompress(revisionString);
|
|
882
|
+
if (revision === undefined) {
|
|
883
|
+
throw new internal_2.UsageError(`Unrecognized revision id: ${revisionString}`);
|
|
884
|
+
}
|
|
885
|
+
// Populated with the commits that came after the target commit, from oldest to newest.
|
|
886
|
+
const commitsToUndo = [];
|
|
887
|
+
const targetCommit = (0, index_js_2.findAncestor)([tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").activeBranch.getHead(), commitsToUndo], (commit) => commit.revision === revision);
|
|
888
|
+
if (targetCommit === undefined) {
|
|
889
|
+
throw new internal_2.UsageError(`No commit found with revision: ${revisionString}`);
|
|
890
|
+
}
|
|
891
|
+
if (!(0, index_js_6.hasSome)(commitsToUndo)) {
|
|
892
|
+
// The target commit is already the head of the branch, so there is nothing to revert.
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
const revisionForInvert = this.mintRevisionTag();
|
|
896
|
+
const toUndo = this.changeFamily.rebaser.compose(commitsToUndo);
|
|
897
|
+
const inverse = this.changeFamily.rebaser.invert((0, index_js_2.makeAnonChange)(toUndo), false, revisionForInvert);
|
|
898
|
+
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply((0, index_js_2.tagChange)(inverse, revisionForInvert), index_js_2.CommitKind.Default, toMetadataTree(customMetadata));
|
|
899
|
+
}
|
|
900
|
+
rebase(view) {
|
|
901
|
+
const checkout = getCheckout(view);
|
|
807
902
|
this.checkNotDisposed("The target branch of the rebase has been disposed and cannot be rebased.");
|
|
808
903
|
checkout.checkNotDisposed("The source branch of the rebase has been disposed and cannot be rebased.");
|
|
809
904
|
this.editLock.checkUnlocked("Rebasing");
|
|
@@ -814,16 +909,16 @@ let TreeCheckout = (() => {
|
|
|
814
909
|
throw new internal_2.UsageError("A view cannot be rebased while it has a pending transaction.");
|
|
815
910
|
}
|
|
816
911
|
(0, internal_1.assert)(!checkout.isSharedBranch, 0xa5d /* Shared branches cannot be rebased onto another branch. */);
|
|
817
|
-
tslib_1.__classPrivateFieldGet(checkout, _TreeCheckout_transaction, "f").
|
|
912
|
+
tslib_1.__classPrivateFieldGet(checkout, _TreeCheckout_transaction, "f").branch.rebaseOnto(tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch);
|
|
818
913
|
}
|
|
819
|
-
rebaseOnto(
|
|
820
|
-
getCheckout(
|
|
914
|
+
rebaseOnto(view) {
|
|
915
|
+
getCheckout(view).rebase(this);
|
|
821
916
|
}
|
|
822
|
-
isMissingEditsFrom(
|
|
823
|
-
const
|
|
917
|
+
isMissingEditsFrom(view) {
|
|
918
|
+
const viewCheckout = getCheckout(view);
|
|
824
919
|
const targetPath = [];
|
|
825
920
|
const ancestor = (0, index_js_2.findCommonAncestor)(this.mainBranch.getHead(), [
|
|
826
|
-
|
|
921
|
+
viewCheckout.mainBranch.getHead(),
|
|
827
922
|
targetPath,
|
|
828
923
|
]);
|
|
829
924
|
if (ancestor === undefined) {
|
|
@@ -831,17 +926,17 @@ let TreeCheckout = (() => {
|
|
|
831
926
|
}
|
|
832
927
|
return targetPath.length > 0;
|
|
833
928
|
}
|
|
834
|
-
computeNetChangeIfRebasedOnto(
|
|
835
|
-
const
|
|
836
|
-
const rebased = (0, index_js_2.rebaseBranch)(this.mintRevisionTag, this.changeFamily.rebaser, tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), tslib_1.__classPrivateFieldGet(
|
|
929
|
+
computeNetChangeIfRebasedOnto(view) {
|
|
930
|
+
const viewCheckout = getCheckout(view);
|
|
931
|
+
const rebased = (0, index_js_2.rebaseBranch)(this.mintRevisionTag, this.changeFamily.rebaser, tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead(), tslib_1.__classPrivateFieldGet(viewCheckout, _TreeCheckout_transaction, "f").branch.getHead());
|
|
837
932
|
if (rebased.sourceChange === undefined) {
|
|
838
933
|
return undefined;
|
|
839
934
|
}
|
|
840
935
|
const revision = this.mintRevisionTag();
|
|
841
936
|
return serializedChange_js_1.SerializedChange.V1.encode(this.idCompressor, this.changeFamily, rebased.sourceChange, revision, undefined);
|
|
842
937
|
}
|
|
843
|
-
merge(
|
|
844
|
-
const checkout = getCheckout(
|
|
938
|
+
merge(view, disposeMerged = true) {
|
|
939
|
+
const checkout = getCheckout(view);
|
|
845
940
|
this.checkNotDisposed("The target branch of the merge has been disposed and cannot be merged.");
|
|
846
941
|
checkout.checkNotDisposed("The source branch of the merge has been disposed and cannot be merged.");
|
|
847
942
|
this.editLock.checkUnlocked("Merging");
|
|
@@ -851,7 +946,7 @@ let TreeCheckout = (() => {
|
|
|
851
946
|
if (checkout.transaction.size > 0) {
|
|
852
947
|
throw new internal_2.UsageError("Views with an open transaction cannot be merged into another view.");
|
|
853
948
|
}
|
|
854
|
-
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
949
|
+
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.merge(tslib_1.__classPrivateFieldGet(checkout, _TreeCheckout_transaction, "f").branch);
|
|
855
950
|
if (disposeMerged && !checkout.isSharedBranch) {
|
|
856
951
|
// Dispose the merged checkout unless it is a shared branch.
|
|
857
952
|
checkout[index_js_6.disposeSymbol]();
|
|
@@ -878,6 +973,8 @@ let TreeCheckout = (() => {
|
|
|
878
973
|
view.dispose();
|
|
879
974
|
}
|
|
880
975
|
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_events, "f").emit("dispose");
|
|
976
|
+
this._branchHistory?.dispose();
|
|
977
|
+
this._branchHistory = undefined;
|
|
881
978
|
}
|
|
882
979
|
getRemovedRoots() {
|
|
883
980
|
this.assertNoUntrackedRoots();
|
|
@@ -917,7 +1014,7 @@ let TreeCheckout = (() => {
|
|
|
917
1014
|
this.revertibleCommitBranches.delete(revision);
|
|
918
1015
|
this.revertibles.delete(revision);
|
|
919
1016
|
}
|
|
920
|
-
revertRevertible(revision, kind, labelTree) {
|
|
1017
|
+
revertRevertible(revision, kind, labelTree, customMetadata) {
|
|
921
1018
|
this.editLock.checkUnlocked("Reverting a commit");
|
|
922
1019
|
if (this.transaction.size > 0) {
|
|
923
1020
|
throw new internal_2.UsageError("Undo is not yet supported during transactions.");
|
|
@@ -927,7 +1024,7 @@ let TreeCheckout = (() => {
|
|
|
927
1024
|
const commitToRevert = revertibleBranch.getHead();
|
|
928
1025
|
const revisionForInvert = this.mintRevisionTag();
|
|
929
1026
|
let change = (0, index_js_2.tagChange)(this.changeFamily.rebaser.invert(commitToRevert, false, revisionForInvert), revisionForInvert);
|
|
930
|
-
const headCommit = tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
1027
|
+
const headCommit = tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.getHead();
|
|
931
1028
|
// Rebase the inverted change onto any commits that occurred after the undoable commits.
|
|
932
1029
|
if (commitToRevert !== headCommit) {
|
|
933
1030
|
// The inverse may be rebased over newer commits which (despite being present in the history)
|
|
@@ -943,9 +1040,9 @@ let TreeCheckout = (() => {
|
|
|
943
1040
|
const previousLabelTreeNode = this.labelTreeNode;
|
|
944
1041
|
this.labelTreeNode = labelTree;
|
|
945
1042
|
try {
|
|
946
|
-
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").
|
|
1043
|
+
tslib_1.__classPrivateFieldGet(this, _TreeCheckout_transaction, "f").branch.apply(change, kind === index_js_2.CommitKind.Default || kind === index_js_2.CommitKind.Redo
|
|
947
1044
|
? index_js_2.CommitKind.Undo
|
|
948
|
-
: index_js_2.CommitKind.Redo);
|
|
1045
|
+
: index_js_2.CommitKind.Redo, toMetadataTree(customMetadata));
|
|
949
1046
|
}
|
|
950
1047
|
finally {
|
|
951
1048
|
this.labelTreeNode = previousLabelTreeNode;
|