Package org.locationtech.geogig.api.porcelain

Examples of org.locationtech.geogig.api.porcelain.PullResult


                pull.addRefSpec(args.get(i));
            }
        }

        try {
            final PullResult result = pull.call();

            ConsoleReader console = cli.getConsole();
            TransferSummary fetchResult = result.getFetchResult();
            FetchResultPrinter.print(fetchResult, console);

            final Ref oldRef = result.getOldRef();
            final Ref newRef = result.getNewRef();

            if (oldRef == null && newRef == null) {
                console.println("Nothing to pull.");
            } else if (Objects.equal(oldRef, newRef)) {
                String name = oldRef == null ? newRef.getName() : oldRef.getName();
                name = Ref.localName(name);
                console.println(name + " already up to date.");
            } else {
                String oldTreeish;
                String newTreeish = newRef.getObjectId().toString();
                if (oldRef == null) {
                    console.println("From " + result.getRemoteName());
                    console.println(" * [new branch]     " + newRef.localName() + " -> "
                            + newRef.getName());

                    oldTreeish = ObjectId.NULL.toString();
                } else {
View Full Code Here


        PullOp command = geogig.command(PullOp.class)
                .setAuthor(authorName.orNull(), authorEmail.orNull()).setRemote(remoteName)
                .setAll(fetchAll).addRefSpec(refSpec);
        try {
            final PullResult result = command.call();
            final Iterator<DiffEntry> iter;
            if (result.getOldRef() != null && result.getNewRef() != null
                    && result.getOldRef().equals(result.getNewRef())) {
                iter = null;
            } else {
                if (result.getOldRef() == null) {
                    iter = geogig.command(DiffOp.class)
                            .setNewVersion(result.getNewRef().getObjectId())
                            .setOldVersion(ObjectId.NULL).call();
                } else {
                    iter = geogig.command(DiffOp.class)
                            .setNewVersion(result.getNewRef().getObjectId())
                            .setOldVersion(result.getOldRef().getObjectId()).call();
                }
            }

            context.setResponseContent(new CommandResponse() {
                @Override
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.porcelain.PullResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.