public ImmutableList<RevTag> getTagList(RepositoryProvider provider, String repoName) { Repository repository = getRepository(provider, repoName); if (repository != null) { return repository.command(TagListOp.class).call(); } return ImmutableList.of(); }
@Override protected ImmutableList<RevTag> _call() { List<Ref> refs = newArrayList( command(ForEachRef.class).setPrefixFilter(Ref.TAGS_PREFIX).call()); // (r) -> r.getObjectId() Function<Ref, ObjectId> fn = new Function<Ref, ObjectId>() { @Override public ObjectId apply(Ref ref) { return ref.getObjectId(); }}; List<ObjectId> tagIds = transform(refs, fn); Iterator<RevTag> alltags; alltags = objectDatabase().getAll(tagIds, BulkOpListener.NOOP_LISTENER, RevTag.class); ImmutableList<RevTag> res = ImmutableList.copyOf(alltags); return res; }
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); } } } }
@Override protected ImmutableList<RevTag> _call() { List<Ref> refs = newArrayList( command(ForEachRef.class).setPrefixFilter(Ref.TAGS_PREFIX).call()); List<ObjectId> tagIds = transform(refs, (r) -> r.getObjectId()); Iterator<RevTag> alltags; alltags = objectDatabase().getAll(tagIds, BulkOpListener.NOOP_LISTENER, RevTag.class); ImmutableList<RevTag> res = ImmutableList.copyOf(alltags); return res; }
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); } } } }
Map<String, RevTag> tags = Maps.uniqueIndex(command(TagListOp.class).call(), (t) -> t.getName()); for (Ref rf : remoteRefs) {
}}; Map<String, RevTag> tags = Maps.uniqueIndex(command(TagListOp.class).call(), fn_revTag_getName); for (Ref rf : remoteRefs) {
private void verifyFetch() throws Exception { // Make sure the local repository got all of the commits from master localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/master").call(); Iterator<RevCommit> logs = localGeogig.geogig.command(LogOp.class).call(); List<RevCommit> logged = Lists.newArrayList(logs); assertEquals(expectedMaster, logged); // Make sure the local repository got all of the commits from Branch1 localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/Branch1") .call(); logs = localGeogig.geogig.command(LogOp.class).call(); logged = Lists.newArrayList(logs); assertEquals(expectedBranch, logged); List<RevTag> tags = localGeogig.geogig.command(TagListOp.class).call(); assertEquals(1, tags.size()); }
private void verifyFetch() throws Exception { // Make sure the local repository got all of the commits from master localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/master").call(); Iterator<RevCommit> logs = localGeogig.geogig.command(LogOp.class).call(); List<RevCommit> logged = Lists.newArrayList(logs); assertEquals(expectedMaster, logged); // Make sure the local repository got all of the commits from Branch1 localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/Branch1") .call(); logs = localGeogig.geogig.command(LogOp.class).call(); logged = Lists.newArrayList(logs); assertEquals(expectedBranch, logged); List<RevTag> tags = localGeogig.geogig.command(TagListOp.class).call(); assertEquals(1, tags.size()); }
private void verifyFetch() throws Exception { // Make sure the local repository got all of the commits from master localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/master").call(); Iterator<RevCommit> logs = localGeogig.geogig.command(LogOp.class).call(); List<RevCommit> logged = Lists.newArrayList(logs); assertEquals(expectedMaster, logged); // Make sure the local repository got all of the commits from Branch1 localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/Branch1") .call(); logs = localGeogig.geogig.command(LogOp.class).call(); logged = Lists.newArrayList(logs); assertEquals(expectedBranch, logged); List<RevTag> tags = localGeogig.geogig.command(TagListOp.class).call(); assertEquals(1, tags.size()); TestSupport.verifyRepositoryContents(localGeogig.geogig.getRepository()); }
private void verifyFetch() throws Exception { // Make sure the local repository got all of the commits from master localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/master").call(); Iterator<RevCommit> logs = localGeogig.geogig.command(LogOp.class).call(); List<RevCommit> logged = Lists.newArrayList(logs); assertEquals(expectedMaster, logged); // Make sure the local repository got all of the commits from Branch1 localGeogig.geogig.command(CheckoutOp.class).setSource("refs/remotes/origin/Branch1") .call(); logs = localGeogig.geogig.command(LogOp.class).call(); logged = Lists.newArrayList(logs); assertEquals(expectedBranch, logged); List<RevTag> tags = localGeogig.geogig.command(TagListOp.class).call(); assertEquals(1, tags.size()); TestSupport.verifyRepositoryContents(localGeogig.geogig.getRepository()); }
final List<RevTag> tags = geogig.command(TagListOp.class).call();