private void rebuildGraph(Repository repo) { repo.command(RebuildGraphOp.class).call(); } }
/** * Runs the command and builds the appropriate response. * * @param context - the context to use for this command */ @Override protected void runInternal(CommandContext context) { final Context geogig = this.getRepositoryContext(context); final ImmutableList<ObjectId> updatedObjects = geogig.command(RebuildGraphOp.class).call(); context.setResponseContent(new CommandResponse() { @Override public void write(ResponseWriter out) throws Exception { out.start(); out.writeRebuildGraphResponse(updatedObjects, quiet); out.finish(); } }); } }
@Override public void runInternal(GeogigCLI cli) throws IOException { ImmutableList<ObjectId> updatedObjects = cli.getGeogig().command(RebuildGraphOp.class) .call(); final Console console = cli.getConsole(); if (updatedObjects.size() > 0) { if (quiet) { console.println(updatedObjects.size() + " graph elements (commits) were fixed."); } else { console.println("The following graph elements (commits) were incomplete or missing and have been fixed:"); for (ObjectId object : updatedObjects) { console.println(object.toString()); } } } else { console.println("No missing or incomplete graph elements (commits) were found."); } } }
@Override public void runInternal(GeogigCLI cli) throws IOException { ImmutableList<ObjectId> updatedObjects = cli.getGeogig().command(RebuildGraphOp.class) .call(); final Console console = cli.getConsole(); if (updatedObjects.size() > 0) { if (quiet) { console.println(updatedObjects.size() + " graph elements (commits) were fixed."); } else { console.println("The following graph elements (commits) were incomplete or missing and have been fixed:"); for (ObjectId object : updatedObjects) { console.println(object.toString()); } } } else { console.println("No missing or incomplete graph elements (commits) were found."); } } }
@Override public void runInternal(GeogigCLI cli) throws IOException { ImmutableList<ObjectId> updatedObjects = cli.getGeogig().command(RebuildGraphOp.class) .call(); final Console console = cli.getConsole(); if (updatedObjects.size() > 0) { if (quiet) { console.println(updatedObjects.size() + " graph elements (commits) were fixed."); } else { console.println("The following graph elements (commits) were incomplete or missing and have been fixed:"); for (ObjectId object : updatedObjects) { console.println(object.toString()); } } } else { console.println("No missing or incomplete graph elements (commits) were found."); } } }
ImmutableList<ObjectId> updated = geogig.command(RebuildGraphOp.class).call(); assertEquals(0, updated.size());
ImmutableList<ObjectId> updated = geogig.command(RebuildGraphOp.class).call(); assertEquals(0, updated.size());
ImmutableList<ObjectId> updated = geogig.command(RebuildGraphOp.class).call(); assertEquals(2, updated.size()); assertTrue(updated.contains(c1.getId()));
ImmutableList<ObjectId> updated = geogig.command(RebuildGraphOp.class).call(); assertEquals(4, updated.size()); assertTrue(updated.contains(c1.getId()));
ImmutableList<ObjectId> updated = geogig.command(RebuildGraphOp.class).call(); assertEquals(4, updated.size()); assertTrue(updated.contains(c1.getId()));
ImmutableList<ObjectId> updated = geogig.command(RebuildGraphOp.class).call(); assertEquals(2, updated.size()); assertTrue(updated.contains(c1.getId()));