@Test public void at() { SimpleVersion v1 = new Builder() .branch("branch1") .changeset(ImmutableMap.of("key", "value1")) .build(); SimpleVersion v2 = new Builder() .branch("branch2") .changeset(ImmutableMap.of("key", "value2")) .parents(v1.revision) .build(); SimpleVersionGraph versionGraph = init(asList(v1, v2)); assertThat(versionGraph.getBranches()).isEqualTo(ImmutableSet.of("branch1", "branch2")); assertThat(versionGraph.getHead("branch1")).isEqualTo(versionGraph.getVersionNode(v1.revision)); assertThat(versionGraph.getHead("branch2")).isEqualTo(versionGraph.getVersionNode(v2.revision)); SimpleVersionGraph at = versionGraph.at(v1.revision); assertThat(at).isNotEqualTo(versionGraph); assertThat(at.getBranches()).isEqualTo(ImmutableSet.of("branch1")); assertThat(at.getHead("branch1")).isEqualTo(versionGraph.getVersionNode(v1.revision)); assertThat(at.getHead("branch2")).isNull(); versionGraph = at.atTip(); assertThat(versionGraph.getBranches()).isEqualTo(ImmutableSet.of("branch1", "branch2")); assertThat(versionGraph.getHead("branch1")).isEqualTo(versionGraph.getVersionNode(v1.revision)); assertThat(versionGraph.getHead("branch2")).isEqualTo(versionGraph.getVersionNode(v2.revision)); }
public static SimpleVersionGraph init() { return new SimpleVersionGraph(); }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } private  SimpleVersionGraph(); private  SimpleVersionGraph(Builder builder); }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } private  SimpleVersionGraph(); private  SimpleVersionGraph(Builder builder); static SimpleVersionGraph init(); static SimpleVersionGraph init(Version<String, String, String>... versions); static SimpleVersionGraph init(Iterable<? extends Version<String, String, String>> versions); }
SimpleVersionGraph extends AbstractVersionGraph<String, String, String, SimpleVersionGraph, SimpleVersionGraph.Builder> { public static SimpleVersionGraph init() { return new SimpleVersionGraph(); } private  SimpleVersionGraph(); private  SimpleVersionGraph(Builder builder); static SimpleVersionGraph init(); static SimpleVersionGraph init(Version<String, String, String>... versions); static SimpleVersionGraph init(Iterable<? extends Version<String, String, String>> versions);  }