Package org.locationtech.geogig.api.porcelain

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


    protected PushOp push() {
        SendPack sendPack = spy(localGeogig.geogig.command(SendPack.class));
        doReturn(Optional.of(remoteRepo)).when(sendPack).getRemoteRepo(any(Remote.class));

        PushOp push = spy(localGeogig.geogig.command(PushOp.class));
        doReturn(sendPack).when(push).command(eq(SendPack.class));

        FetchOp fetch = fetch();
        // when(push.command(FetchOp.class)).thenReturn(fetch);
        doReturn(fetch).when(push).command(eq(FetchOp.class));
View Full Code Here


            Optional<RevObject> childObject = localGeogig.geogig.command(RevObjectParse.class)
                    .setObjectId(oId).call();
            assertTrue(childObject.isPresent());
        }

        PushOp push = push();
        push.setAll(true).call();

        Iterator<RevCommit> logs = remoteGeogig.geogig.command(LogOp.class).call();
        List<RevCommit> logged = new ArrayList<RevCommit>();
        for (; logs.hasNext();) {
            logged.add(logs.next());
View Full Code Here

                .setNewValue(report.getMergeCommit().getId()).call();

        // Checkout master
        localGeogig.geogig.command(CheckoutOp.class).setSource("master").call();

        PushOp push = push();
        push.addRefSpec("refs/heads/master").call();

        logs = remoteGeogig.geogig.command(LogOp.class).call();
        List<RevCommit> logged = new ArrayList<RevCommit>();
        for (; logs.hasNext();) {
            logged.add(logs.next());
View Full Code Here

        // Merge Branch1 into master
        MergeOp merge = localGeogig.geogig.command(MergeOp.class);
        MergeReport report = merge.addCommit(Suppliers.ofInstance(expected.get(0).getId()))
                .setMessage("Merge").call();

        PushOp push = push();
        push.addRefSpec("refs/heads/master").call();

        logs = remoteGeogig.geogig.command(LogOp.class).call();
        List<RevCommit> logged = new ArrayList<RevCommit>();
        for (; logs.hasNext();) {
            logged.add(logs.next());
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.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

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

        // Push the commit
        PushOp push = push();
        push.setRemote("origin").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

    @Test
    public void testPushToRemoteHEAD() throws Exception {
        insertAndAdd(localGeogig.geogig, lines3);
        localGeogig.geogig.command(CommitOp.class).call();

        PushOp push = push();
        try {
            push.setRemote("origin").addRefSpec("HEAD").call();
            fail();
        } catch (SynchronizationException e) {
            assertEquals(SynchronizationException.StatusCode.CANNOT_PUSH_TO_SYMBOLIC_REF,
                    e.statusCode);
        }
View Full Code Here

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

        // Push the commit
        PushOp push = push();
        push.setAll(true).call();

        // verify that the remote got the commit on both branches
        remoteGeogig.geogig.command(CheckoutOp.class).setSource("master").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();
        expectedMaster.addFirst(commit);

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

        assertTrue(remoteGeogig.geogig.command(RefParse.class).setName("NewRemoteBranch").call()
                .isPresent());

        // verify that the remote got the commit
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("master:NewRemoteBranch");
        push.addRefSpec("Branch1:NewRemoteBranch2");
        push.call();

        assertTrue(remoteGeogig.geogig.command(RefParse.class).setName("NewRemoteBranch").call()
                .isPresent());
        assertTrue(remoteGeogig.geogig.command(RefParse.class).setName("NewRemoteBranch2").call()
                .isPresent());
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.