@Test public void squash_linear_history() { SimpleVersion v1 = new SimpleVersion.Builder(rev(1)) .changeset(mapOf("key", "value1")) .meta("v1 meta") .build(); SimpleVersion v2 = new SimpleVersion.Builder(rev(2)) .parents(v1.revision) .changeset(mapOf("key", "value2")) .meta("v2 meta") .build(); SimpleVersion v3 = new SimpleVersion.Builder(rev(3)) .parents(v2.revision) .changeset(mapOf("key2", "value1")) .meta("v3 meta") .build(); SimpleVersionGraph versionGraph = SimpleVersionGraph.init(v1, v2, v3); assertRevisions(versionGraph, setOf(v3.revision), asList(v3.revision), asList(v2.revision, v1.revision)); SimpleVersionGraph graph = versionGraph.optimize(v3.revision).getGraph(); assertNotFound(graph, v2.revision); assertNotFound(graph, v1.revision); VersionNode<String, String, String> node = graph.getVersionNode(v3.revision); assertThat(node.getChangeset()).isEqualTo(mapOf("key", "value2", "key2", "value1")); assertThat(node.getParentRevisions()).isEmpty(); assertThat(node.getMeta()).isEqualTo("v3 meta"); }
public G getGraph() { return graph; }
OptimizedGraph { public G getGraph() { return graph; } }
OptimizedGraph { public G getGraph() { return graph; } OptimizedGraph(G graph, List<Revision> keptRevisions, List<Revision> squashedRevisions); }
OptimizedGraph { public G getGraph() { return graph; } OptimizedGraph(G graph, List<Revision> keptRevisions, List<Revision> squashedRevisions); G getGraph(); List<Revision> getSquashedRevisions(); List<Revision> getKeptRevisions(); }
OptimizedGraph { public G getGraph() { return graph; } OptimizedGraph(G graph, List<Revision> keptRevisions, List<Revision> squashedRevisions); G getGraph(); List<Revision> getSquashedRevisions(); List<Revision> getKeptRevisions();  }