private void listTags(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); ImmutableList<RevTag> tags = geogig.command(TagListOp.class).call(); for (RevTag tag : tags) { try { cli.getConsole().println(tag.getName()); } catch (IOException e) { throw new RuntimeException(e); } } } }
private void listTags(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); ImmutableList<RevTag> tags = geogig.command(TagListOp.class).call(); for (RevTag tag : tags) { try { cli.getConsole().println(tag.getName()); } catch (IOException e) { throw Throwables.propagate(e); } } } }
private void listTags(GeogigCLI cli) { GeoGIG geogig = cli.getGeogig(); ImmutableList<RevTag> tags = geogig.command(TagListOp.class).call(); for (RevTag tag : tags) { try { cli.getConsole().println(tag.getName()); } catch (IOException e) { throw new RuntimeException(e); } } } }
@Then("^the response should contain the index ID for tree \"([^\"]*)\"$") public void the_response_contains_indexID(String tree) throws Throwable { GeoGIG gig = localRepo.geogigCLI.getGeogig(); ObjectId canonicalTreeId = gig.command(ResolveTreeish.class).setTreeish("HEAD:" + tree).call().get(); Optional<IndexInfo> indexInfo = gig.getRepository().indexDatabase().getIndexInfo(tree,"pp"); Optional<ObjectId> indexedTree = gig.getRepository().indexDatabase().resolveIndexedTree(indexInfo.get(),canonicalTreeId); if (!indexedTree.isPresent()) { fail(); } String indexId = indexedTree.get().toString(); String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); assertTrue("'" + actual + "' does not contain ID '" + indexId.substring(0,8), actual.contains(indexId.toString().substring(0,8))); }
@Then("^the response should contain the index ID for tree \"([^\"]*)\"$") public void the_response_contains_indexID(String tree) throws Throwable { GeoGIG gig = localRepo.geogigCLI.getGeogig(); ObjectId canonicalTreeId = gig.command(ResolveTreeish.class).setTreeish("HEAD:" + tree).call().get(); Optional<IndexInfo> indexInfo = gig.getRepository().indexDatabase().getIndexInfo(tree,"pp"); Optional<ObjectId> indexedTree = gig.getRepository().indexDatabase().resolveIndexedTree(indexInfo.get(),canonicalTreeId); if (!indexedTree.isPresent()) { fail(); } String indexId = indexedTree.get().toString(); String actual = localRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/"); assertTrue("'" + actual + "' does not contain ID '" + indexId.substring(0,8), actual.contains(indexId.toString().substring(0,8))); }
@Given("^the repository has a truncated graph database$") public void the_repository_has_a_truncated_graph_database() throws Throwable { Repository repository = localRepo.geogigCLI.getGeogig().getRepository(); repository.graphDatabase().truncate(); }
@Given("^the repository has a truncated graph database$") public void the_repository_has_a_truncated_graph_database() throws Throwable { Repository repository = localRepo.geogigCLI.getGeogig().getRepository(); repository.graphDatabase().truncate(); }
@Given("^the repository has a truncated graph database$") public void the_repository_has_a_truncated_graph_database() throws Throwable { Repository repository = localRepo.geogigCLI.getGeogig().getRepository(); repository.graphDatabase().truncate(); }
@Override protected void runInternal(GeogigCLI cli) throws InvalidParameterException, CommandFailedException, IOException { Repository repo = cli.getGeogig().getRepository(); int treesRebuilt = repo.command(BuildFullHistoryIndexOp.class)// .setTreeRefSpec(treeRefSpec)// .setAttributeName(attribute)// .setProgressListener(cli.getProgressListener())// .call(); cli.getConsole().println(treesRebuilt + " trees were rebuilt."); } }
@Override protected void runInternal(GeogigCLI cli) throws InvalidParameterException, CommandFailedException, IOException { Repository repo = cli.getGeogig().getRepository(); repo.command(DropIndexOp.class)// .setTreeRefSpec(treeRefSpec)// .setAttributeName(attribute)// .setProgressListener(cli.getProgressListener())// .call(); cli.getConsole().println("Index successfully dropped."); } }
@Given("^I have a remote ref called \"([^\"]*)\"$") public void i_have_a_remote_ref_called(String expected) throws Throwable { String ref = "refs/remotes/origin/" + expected; localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(UpdateRef.class).setName(ref) .setNewValue(ObjectId.NULL).call(); Optional<Ref> refValue = localRepo.geogigCLI.getGeogig(Hints.readWrite()) .command(RefParse.class).setName(ref).call(); assertTrue(refValue.isPresent()); assertEquals(refValue.get().getObjectId(), ObjectId.NULL); }
@Given("^I have a remote ref called \"([^\"]*)\"$") public void i_have_a_remote_ref_called(String expected) throws Throwable { String ref = "refs/remotes/origin/" + expected; localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(UpdateRef.class).setName(ref) .setNewValue(ObjectId.NULL).call(); Optional<Ref> refValue = localRepo.geogigCLI.getGeogig(Hints.readWrite()) .command(RefParse.class).setName(ref).call(); assertTrue(refValue.isPresent()); assertEquals(refValue.get().getObjectId(), ObjectId.NULL); }
@Given("^I have a remote ref called \"([^\"]*)\"$") public void i_have_a_remote_ref_called(String expected) throws Throwable { String ref = "refs/remotes/origin/" + expected; localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(UpdateRef.class).setName(ref) .setNewValue(ObjectId.NULL).call(); Optional<Ref> refValue = localRepo.geogigCLI.getGeogig(Hints.readWrite()) .command(RefParse.class).setName(ref).call(); assertTrue(refValue.isPresent()); assertEquals(refValue.get().getObjectId(), ObjectId.NULL); }
private AutoCloseableIterator<DiffEntry> buildEntries(GeogigCLI cli, String oldVersion, String newVersion) { DiffOp diff = cli.getGeogig().command(DiffOp.class); diff.setOldVersion(oldVersion).setNewVersion(newVersion).setCompareIndex(cached); AutoCloseableIterator<DiffEntry> entries; if (paths.isEmpty()) { entries = diff.setProgressListener(cli.getProgressListener()).call(); } else { entries = AutoCloseableIterator.emptyIterator(); for (String path : paths) { AutoCloseableIterator<DiffEntry> moreEntries = diff.setFilter(path) .setProgressListener(cli.getProgressListener()).call(); entries = AutoCloseableIterator.concat(entries, moreEntries); } } return entries; }
@Given("^I have a merge conflict state$") public void I_have_a_merge_conflict_state() throws Throwable { I_have_conflicting_branches(); Ref branch = localRepo.geogigCLI.getGeogig(Hints.readOnly()).command(RefParse.class) .setName("branch1").call().get(); try { localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(MergeOp.class) .addCommit(branch.getObjectId()).call(); fail(); } catch (MergeConflictsException e) { } }
@Given("^I have a merge conflict state$") public void I_have_a_merge_conflict_state() throws Throwable { I_have_conflicting_branches(); Ref branch = localRepo.geogigCLI.getGeogig(Hints.readOnly()).command(RefParse.class) .setName("branch1").call().get(); try { localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(MergeOp.class) .addCommit(branch.getObjectId()).call(); fail(); } catch (MergeConflictsException e) { } }
@Given("^I have a merge conflict state$") public void I_have_a_merge_conflict_state() throws Throwable { I_have_conflicting_branches(); Ref branch = localRepo.geogigCLI.getGeogig(Hints.readOnly()).command(RefParse.class) .setName("branch1").call().get(); try { localRepo.geogigCLI.getGeogig(Hints.readWrite()).command(MergeOp.class) .addCommit(branch.getObjectId()).call(); fail(); } catch (MergeConflictsException e) { } }
@Given("^I have a remote tag called \"([^\"]*)\"$") public void i_have_a_remote_tag_called(String expected) throws Throwable { localRepo.geogigCLI.getGeogig(Hints.readWrite()) // .command(TagCreateOp.class) // .setName(expected) // .setMessage("Tagged " + expected) // .setCommitId(ObjectId.NULL) // .call(); }
@Given("^I have a remote tag called \"([^\"]*)\"$") public void i_have_a_remote_tag_called(String expected) throws Throwable { localRepo.geogigCLI.getGeogig(Hints.readWrite()) // .command(TagCreateOp.class) // .setName(expected) // .setMessage("Tagged " + expected) // .setCommitId(ObjectId.NULL) // .call(); }
@Given("^I have a remote tag called \"([^\"]*)\"$") public void i_have_a_remote_tag_called(String expected) throws Throwable { localRepo.geogigCLI.getGeogig(Hints.readWrite()) // .command(TagCreateOp.class) // .setName(expected) // .setMessage("Tagged " + expected) // .setCommitId(ObjectId.NULL) // .call(); }