"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransactionEnricher = void 0;
/**
 * Utility for producing an enriched commit out of multiple transaction steps
 */
class TransactionEnricher {
    rebaser;
    enricher;
    transactionCommits = [];
    constructor(rebaser, enricher) {
        this.rebaser = rebaser;
        this.enricher = enricher;
    }
    addTransactionSteps(commit) {
        const change = this.enricher.updateChangeEnrichments(commit.change, commit.revision);
        this.transactionCommits.push({ ...commit, change });
    }
    getComposedChange(revision) {
        const squashed = this.rebaser.compose(this.transactionCommits);
        const tagged = this.rebaser.changeRevision(squashed, revision);
        return tagged;
    }
}
exports.TransactionEnricher = TransactionEnricher;
//# sourceMappingURL=transactionEnricher.js.map