public boolean exists(final ObjectId commitId) { synchronized (delegate) { return delegate.exists(commitId); } }
public boolean exists(final ObjectId commitId) { synchronized (delegate) { return delegate.exists(commitId); } }
@Override protected boolean existsInDestination(ObjectId commitId) { return destination.graphDatabase().exists(commitId); }
@Override protected boolean existsInDestination(ObjectId commitId) { return destination.graphDatabase().exists(commitId); }
@Override protected Evaluation evaluate(CommitNode commitNode) { if (destination.graphDatabase().exists(commitNode.getObjectId())) { return Evaluation.EXCLUDE_AND_PRUNE; } return Evaluation.INCLUDE_AND_CONTINUE; }
@Override protected Evaluation evaluate(CommitNode commitNode) { if (destination.graphDatabase().exists(commitNode.getObjectId())) { return Evaluation.EXCLUDE_AND_PRUNE; } return Evaluation.INCLUDE_AND_CONTINUE; }
Ref newRef = remoteRef; if (!(newRef instanceof SymRef) && local.graphDatabase().exists(remoteRef.getObjectId())) { ObjectId mappedCommit = local.graphDatabase() .getMapping(remoteRef.getObjectId());
public @Test void testPutUpdatesGraphDatabase() { ObjectDatabase db = db(); GraphDatabase graph = db.getGraphDatabase(); assertNotNull(graph); List<RevCommit> commits = createCommits(2); RevCommit c1 = commits.get(0); RevCommit c2 = commits.get(1); assertFalse(graph.exists(c1.getId())); assertFalse(graph.exists(c2.getId())); db.put(c1); db.put(c2); assertTrue(graph.exists(c1.getId())); assertTrue(graph.exists(c2.getId())); }
public @Test void testPutUpdatesGraphDatabase() { ObjectDatabase db = db(); GraphDatabase graph = db.getGraphDatabase(); assertNotNull(graph); List<RevCommit> commits = createCommits(2); RevCommit c1 = commits.get(0); RevCommit c2 = commits.get(1); assertFalse(graph.exists(c1.getId())); assertFalse(graph.exists(c2.getId())); db.put(c1); db.put(c2); assertTrue(graph.exists(c1.getId())); assertTrue(graph.exists(c2.getId())); }
GraphDatabase graphdb = local.graphDatabase(); ObjectId headId = remoteRef.getObjectId(); if (!(newRef instanceof SymRef) && graphdb.exists(headId)) { ObjectId mappedCommit = graphdb.getMapping(headId); if (mappedCommit != null) {
GraphDatabase graphdb = local.graphDatabase(); ObjectId headId = remoteRef.getObjectId(); if (!(newRef instanceof SymRef) && graphdb.exists(headId)) { ObjectId mappedCommit = graphdb.getMapping(headId); if (mappedCommit != null) {
@Test public void testTruncate() throws IOException { 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)); assertTrue(database.exists(rootId)); assertTrue(database.exists(commit1)); assertTrue(database.exists(commit2)); assertNotNull(database.getNode(rootId)); assertNotNull(database.getNode(commit1)); assertNotNull(database.getNode(commit2)); assertEquals(1, database.getDepth(commit2)); database.truncate(); // not using getNode for assertions cause it's contract is not well defined for an invalid // argument and implementations behave differently. Created an issue to fix it. // assertNull(database.getNode(rootId)); // assertNull(database.getNode(commit1)); // assertNull(database.getNode(commit2)); // assertEquals(0, database.getDepth(commit2)); assertFalse(database.exists(rootId)); assertFalse(database.exists(commit1)); assertFalse(database.exists(commit2)); }
public @Test void testPutAllUpdatesGraphDatabase() { ObjectDatabase db = db(); GraphDatabase graph = db.getGraphDatabase(); assertNotNull(graph); List<RevCommit> commits = createCommits(100); db.putAll(commits.iterator()); commits.forEach((c) -> assertTrue(c.getId().toString(), graph.exists(c.getId()))); }
@Test public void testTruncate() throws IOException { 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)); assertTrue(database.exists(rootId)); assertTrue(database.exists(commit1)); assertTrue(database.exists(commit2)); assertNotNull(database.getNode(rootId)); assertNotNull(database.getNode(commit1)); assertNotNull(database.getNode(commit2)); assertEquals(1, database.getDepth(commit2)); database.truncate(); // not using getNode for assertions cause it's contract is not well defined for an invalid // argument and implementations behave differently. Created an issue to fix it. // assertNull(database.getNode(rootId)); // assertNull(database.getNode(commit1)); // assertNull(database.getNode(commit2)); // assertEquals(0, database.getDepth(commit2)); assertFalse(database.exists(rootId)); assertFalse(database.exists(commit1)); assertFalse(database.exists(commit2)); }
assertTrue(database.exists(commit2)); assertEquals("Size of " + children, 0, children.size()); assertEquals(1, parents.size()); children = database.getChildren(commit1); parents = database.getParents(commit1); assertTrue(database.exists(commit1)); assertEquals(1, children.size()); assertEquals(commit2, children.get(0)); children = database.getChildren(rootId); parents = database.getParents(rootId); assertTrue(database.exists(rootId)); assertEquals(1, children.size()); assertEquals(commit1, children.get(0));
public @Test void testPutAllUpdatesGraphDatabase() { ObjectDatabase db = db(); GraphDatabase graph = db.getGraphDatabase(); assertNotNull(graph); List<RevCommit> commits = createCommits(100); db.putAll(commits.iterator()); commits.forEach((c) -> assertTrue(c.getId().toString(), graph.exists(c.getId()))); }
assertTrue(database.exists(commit2)); assertEquals("Size of " + children, 0, children.size()); assertEquals(1, parents.size()); children = database.getChildren(commit1); parents = database.getParents(commit1); assertTrue(database.exists(commit1)); assertEquals(1, children.size()); assertEquals(commit2, children.get(0)); children = database.getChildren(rootId); parents = database.getParents(rootId); assertTrue(database.exists(rootId)); assertEquals(1, children.size()); assertEquals(commit1, children.get(0));
case COMMIT: assertTrue("no graph entry found for commit " + obj, repo.graphDatabase().exists(obj.getId())); verifyAllReachableContents(repo, ((RevCommit) obj).getTreeId(), pathToObject, allIds); break;
case COMMIT: assertTrue("no graph entry found for commit " + obj, repo.graphDatabase().exists(obj.getId())); verifyAllReachableContents(repo, ((RevCommit) obj).getTreeId(), pathToObject, allIds); break;