|
@@ -4,55 +4,3 @@ export interface Delta {
|
|
|
// Get deltas that are conflicting with this delta.
|
|
|
getConflicts(): Array<Delta>;
|
|
|
}
|
|
|
-
|
|
|
-// export class CompositeDelta implements Delta {
|
|
|
-// readonly deltas: Array<Delta>;
|
|
|
-// readonly dependencies: Array<CompositeDelta>;
|
|
|
-
|
|
|
-// constructor(deltas: Array<Delta>, dependencies: Array<CompositeDelta>) {
|
|
|
-// this.deltas = deltas;
|
|
|
-// this.dependencies = dependencies;
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// export class CompositeDeltaGraph {
|
|
|
-// conflictRegistry: ConflictRegistry;
|
|
|
-// containedBy: Map<Delta, CompositeDelta>;
|
|
|
-
|
|
|
-// constructor(lowerLevelConflictRegistry: ConflictRegistry) {
|
|
|
-// this.conflictRegistry = new ConflictRegistry();
|
|
|
-// this.containedBy = new Map();
|
|
|
-// this.lowerLevelConflictRegistry = lowerLevelConflictRegistry;
|
|
|
-// }
|
|
|
-
|
|
|
-// newCompositeDelta(deltas: Array<Delta>) {
|
|
|
-// // Find dependencies
|
|
|
-// const dependencies = [];
|
|
|
-// for (const delta of deltas) {
|
|
|
-// for (const dependency of delta.getDependencies()) {
|
|
|
-// const dependencyContainment = this.containedBy(dependency);
|
|
|
-// if (dependencyContainment !== undefined) {
|
|
|
-// // add dependency if we don't have it yet
|
|
|
-// if (!dependencies.includes(dependencyContainment)) {
|
|
|
-// dependencies.push(dependencyContainment);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// const composite = new CompositeDelta(deltas, dependencies);
|
|
|
-// for (const delta of deltas) {
|
|
|
-// this.containedBy.set(delta, composite);
|
|
|
-// }
|
|
|
-// // Find conflicts
|
|
|
-// for (const delta of deltas) {
|
|
|
-// for (const conflictsWith of this.lowerLevelConflictRegistry.lookup(delta)) {
|
|
|
-// const conflictContainment = this.containedBy(conflictsWith);
|
|
|
-// this.conflictRegistry.registerConflict({first: () => composite, second: () => conflictContainment});
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// return composite;
|
|
|
-// }
|
|
|
-// }
|