@Test public void remove_tombstones() { SimpleVersion v1 = new SimpleVersion.Builder(rev(1)) .changeset(mapOf("key1", "value1", "key2", "value1", "key3", "value1")) .build(); SimpleVersion v2 = new SimpleVersion.Builder(rev(2)) .parents(v1.revision) .changeset(mapOf("key1", null)) .build(); SimpleVersion v3 = new SimpleVersion.Builder(rev(3)) .parents(v2.revision) .changeset(mapOf("key2", null)) .build(); SimpleVersion v4 = new SimpleVersion.Builder(rev(4)) .parents(v2.revision) .changeset(mapOf("key3", null)) .build(); SimpleVersion v5 = new SimpleVersion.Builder(rev(5)) .parents(v3.revision, v4.revision) .changeset(mapOf("key4", "value1")) .build(); SimpleVersionGraph versionGraph = SimpleVersionGraph.init(v1, v2, v3, v4, v5); assertRevisions(versionGraph, setOf(v5.revision), asList(v5.revision), asList(v4.revision, v3.revision, v2.revision, v1.revision)); assertRevisions(versionGraph, setOf(v3.revision, v4.revision, v5.revision), asList(v2.revision, v3.revision, v4.revision, v5.revision), asList(v1.revision)); assertRevisions(versionGraph, setOf(v5.revision, v2.revision), asList(v2.revision, v5.revision), asList(v4.revision, v3.revision, v1.revision)); SimpleVersionGraph graph = versionGraph.optimize(v5.revision).getGraph(); assertNotFound(graph, v1.revision); assertNotFound(graph, v2.revision); assertNotFound(graph, v3.revision); assertNotFound(graph, v4.revision); VersionNode<String, String, String> v4node = graph.getVersionNode(v5.revision); assertThat(v4node.getChangeset()).isEqualTo(mapOf("key4", "value1")); assertThat(v4node.getParentRevisions()).isEmpty(); }
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();  }