Package org.locationtech.geogig.api.porcelain

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


        assertEquals(expectedBranch, logged);
    }

    @Test
    public void testDeleteRemoteBranch() throws Exception {
        PushOp push = push();
        push.addRefSpec(":Branch1");
        push.call();

        assertFalse(remoteGeogig.geogig.command(RefParse.class).setName("Branch1").call()
                .isPresent());
    }
View Full Code Here


        insertAndAdd(localGeogig.geogig, lines3);
        RevCommit commit = localGeogig.geogig.command(CommitOp.class).call();
        expectedMaster.addFirst(commit);

        // Push the commit
        PushOp push = push();
        push.addRefSpec(":");
        push.call();

        // verify that the remote got the commit
        Iterator<RevCommit> logs = remoteGeogig.geogig.command(LogOp.class).call();
        List<RevCommit> logged = new ArrayList<RevCommit>();
        for (; logs.hasNext();) {
View Full Code Here

        RevCommit commit = localGeogig.geogig.command(CommitOp.class).call();
        expectedBranch.addFirst(commit);
        localGeogig.geogig.command(CheckoutOp.class).setSource("master").call();

        // Push the commit
        PushOp push = push();
        push.addRefSpec("Branch1");
        push.call();

        // verify that the remote got the commit
        Optional<Ref> remoteRef = remoteGeogig.geogig.command(RefParse.class).setName("Branch1")
                .call();
        assertTrue(remoteRef.isPresent());
View Full Code Here

        RevCommit commit = localGeogig.geogig.command(CommitOp.class).call();
        expectedBranch.addFirst(commit);
        localGeogig.geogig.command(CheckoutOp.class).setSource("master").call();

        // Push the commit
        PushOp push = push();
        push.addRefSpec("+Branch1");
        push.call();

        // verify that the remote got the commit
        remoteGeogig.geogig.command(CheckoutOp.class).setSource("Branch1").call();
        Iterator<RevCommit> logs = remoteGeogig.geogig.command(LogOp.class).call();
        List<RevCommit> logged = new ArrayList<RevCommit>();
View Full Code Here

        insertAndAdd(localGeogig.geogig, lines3);
        RevCommit commit = localGeogig.geogig.command(CommitOp.class).call();
        expectedBranch.addFirst(commit);

        // Push the commit
        PushOp push = push();
        push.addRefSpec("Branch1:master:HEAD");
        exception.expect(IllegalArgumentException.class);
        push.call();
    }
View Full Code Here

     * Executes the push command using the provided options.
     */
    @Override
    public void runInternal(GeogigCLI cli) throws IOException {

        PushOp push = cli.getGeogig().command(PushOp.class);
        push.setProgressListener(cli.getProgressListener());
        push.setAll(all);

        if (args != null) {
            if (args.size() > 0) {
                push.setRemote(args.get(0));
            }
            for (int i = 1; i < args.size(); i++) {
                push.addRefSpec(args.get(i));
            }
        }
        try {
            // TODO: listen on progress?
            TransferSummary dataPushed = push.call();
            if (dataPushed.isEmpty()) {
                cli.getConsole().println("Nothing to push.");
            }
        } catch (SynchronizationException e) {
            switch (e.statusCode) {
View Full Code Here

     */
    @Override
    public void run(CommandContext context) {
        final Context geogig = this.getCommandLocator(context);

        PushOp command = geogig.command(PushOp.class);

        if (refSpec != null) {
            command.addRefSpec(refSpec);
        }

        try {
            final TransferSummary dataPushed = command.setAll(pushAll).setRemote(remoteName).call();
            context.setResponseContent(new CommandResponse() {
                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
                    out.writeElement("Push", "Success");
View Full Code Here

TOP

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

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.