public ImmutableList<ObjectId> getChildren(ObjectId commitId) throws IllegalArgumentException { synchronized (delegate) { return delegate.getChildren(commitId); } }
public ImmutableList<ObjectId> getChildren(ObjectId commitId) throws IllegalArgumentException { synchronized (delegate) { return delegate.getChildren(commitId); } }
ImmutableList<ObjectId> children = this.graphDb.getChildren(lastCommit.getId()); if (children.size() > 1) { stopPoints.add(lastCommit.getId());
ImmutableList<ObjectId> children = this.graphDb.getChildren(lastCommit.getId()); if (children.size() > 1) { stopPoints.add(lastCommit.getId());
@Test public void testGetChildren() { ObjectId rootId = RevObjectTestSupport.hashString("root"); database.put(rootId, ImmutableList.of()); ObjectId commit1 = RevObjectTestSupport.hashString("c1"); database.put(commit1, ImmutableList.of(rootId)); ObjectId commit2 = RevObjectTestSupport.hashString("c2"); database.put(commit2, ImmutableList.of(commit1, rootId)); ImmutableList<ObjectId> children = database.getChildren(rootId); assertEquals(2, children.size()); assertTrue(children.contains(commit1)); assertTrue(children.contains(commit2)); children = database.getChildren(commit1); assertEquals(1, children.size()); assertTrue(children.contains(commit2)); children = database.getChildren(commit2); assertEquals(0, children.size()); children = database.getChildren(RevObjectTestSupport.hashString("nonexistent")); assertEquals(0, children.size()); }
@Test public void testGetChildren() { ObjectId rootId = RevObjectTestSupport.hashString("root"); database.put(rootId, ImmutableList.of()); ObjectId commit1 = RevObjectTestSupport.hashString("c1"); database.put(commit1, ImmutableList.of(rootId)); ObjectId commit2 = RevObjectTestSupport.hashString("c2"); database.put(commit2, ImmutableList.of(commit1, rootId)); ImmutableList<ObjectId> children = database.getChildren(rootId); assertEquals(2, children.size()); assertTrue(children.contains(commit1)); assertTrue(children.contains(commit2)); children = database.getChildren(commit1); assertEquals(1, children.size()); assertTrue(children.contains(commit2)); children = database.getChildren(commit2); assertEquals(0, children.size()); children = database.getChildren(RevObjectTestSupport.hashString("nonexistent")); assertEquals(0, children.size()); }
commitToSquash = toSquash.next(); squashedIds.add(commitToSquash.getId()); Preconditions.checkArgument(graphDb.getChildren(commitToSquash.getId()).size() < 2, "The commits to squash include a branch starting point. Squashing that type of commit is not supported."); for (Ref ref : refs) { Preconditions.checkArgument(graphDb.getChildren(commit.getId()).size() < 2, "The commits after the ones to squash include a branch starting point. This scenario is not supported."); for (Ref ref : refs) {
commitToSquash = toSquash.next(); squashedIds.add(commitToSquash.getId()); Preconditions.checkArgument(graphDb.getChildren(commitToSquash.getId()).size() < 2, "The commits to squash include a branch starting point. Squashing that type of commit is not supported."); for (Ref ref : refs) { Preconditions.checkArgument(graphDb.getChildren(commit.getId()).size() < 2, "The commits after the ones to squash include a branch starting point. This scenario is not supported."); for (Ref ref : refs) {
database.put(commit2, parents); ImmutableList<ObjectId> children = database.getChildren(commit2); parents = database.getParents(commit2); assertTrue(database.exists(commit2)); assertEquals(1, parents.size()); assertEquals(commit1, parents.get(0)); children = database.getChildren(commit1); parents = database.getParents(commit1); assertTrue(database.exists(commit1)); assertEquals(1, parents.size()); assertEquals(rootId, parents.get(0)); children = database.getChildren(rootId); parents = database.getParents(rootId); assertTrue(database.exists(rootId));
database.put(commit2, parents); ImmutableList<ObjectId> children = database.getChildren(commit2); parents = database.getParents(commit2); assertTrue(database.exists(commit2)); assertEquals(1, parents.size()); assertEquals(commit1, parents.get(0)); children = database.getChildren(commit1); parents = database.getParents(commit1); assertTrue(database.exists(commit1)); assertEquals(1, parents.size()); assertEquals(rootId, parents.get(0)); children = database.getChildren(rootId); parents = database.getParents(rootId); assertTrue(database.exists(rootId));
ImmutableList<ObjectId> oldCommits = graphDatabase().getChildren(commit.getId()); RevTree oldCanonicalTree = RevTree.EMPTY; for (ObjectId oldCommitId : oldCommits) {
ImmutableList<ObjectId> oldCommits = graphDatabase().getChildren(commit.getId()); RevTree oldCanonicalTree = RevTree.EMPTY; for (ObjectId oldCommitId : oldCommits) {