Examples of Commit


Examples of org.apache.jackrabbit.mk.model.Commit

            StoredCommit toCommit = rep.getCommit(toRevisionId);
            if (toCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + toRevisionId);
            }

            Commit fromCommit;
            if (toRevisionId.equals(fromRevisionId)) {
                fromCommit = toCommit;
            } else {
                fromCommit = rep.getCommit(fromRevisionId);
                if (fromCommit.getCommitTS() > toCommit.getCommitTS()) {
                    // negative range, return empty journal
                    return "[]";
                }
            }
            if (fromCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + fromRevisionId);
            }

            // collect commits, starting with toRevisionId
            // and traversing parent commit links until we've reached
            // fromRevisionId
            StoredCommit commit = toCommit;
            while (commit != null) {
                commits.add(commit);
                if (commit.getId().equals(fromRevisionId)) {
                    break;
                }
                Id commitId = commit.getParentId();
                if (commitId == null) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
                commit = rep.getCommit(commitId);
                if (commit.getCommitTS() < fromCommit.getCommitTS()) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.jackrabbit.mk.model.Commit

            StoredCommit toCommit = rep.getCommit(toRevisionId);
            if (toCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + toRevisionId);
            }

            Commit fromCommit;
            if (toRevisionId.equals(fromRevisionId)) {
                fromCommit = toCommit;
            } else {
                fromCommit = rep.getCommit(fromRevisionId);
                if (fromCommit.getCommitTS() > toCommit.getCommitTS()) {
                    // negative range, return empty journal
                    return "[]";
                }
            }
            if (fromCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + fromRevisionId);
            }

            // collect commits, starting with toRevisionId
            // and traversing parent commit links until we've reached
            // fromRevisionId
            StoredCommit commit = toCommit;
            while (commit != null) {
                commits.add(commit);
                if (commit.getId().equals(fromRevisionId)) {
                    break;
                }
                Id commitId = commit.getParentId();
                if (commitId == null) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
                commit = rep.getCommit(commitId);
                if (commit.getCommitTS() < fromCommit.getCommitTS()) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.jackrabbit.mk.model.Commit

            StoredCommit toCommit = rep.getCommit(toRevisionId);
            if (toCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + toRevisionId);
            }

            Commit fromCommit;
            if (toRevisionId.equals(fromRevisionId)) {
                fromCommit = toCommit;
            } else {
                fromCommit = rep.getCommit(fromRevisionId);
                if (fromCommit.getCommitTS() > toCommit.getCommitTS()) {
                    // negative range, return empty journal
                    return "[]";
                }
            }
            if (fromCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + fromRevisionId);
            }

            // collect commits, starting with toRevisionId
            // and traversing parent commit links until we've reached
            // fromRevisionId
            StoredCommit commit = toCommit;
            while (commit != null) {
                commits.add(commit);
                if (commit.getId().equals(fromRevisionId)) {
                    break;
                }
                Id commitId = commit.getParentId();
                if (commitId == null) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
                commit = rep.getCommit(commitId);
                if (commit.getCommitTS() < fromCommit.getCommitTS()) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.jackrabbit.mk.model.Commit

            StoredCommit toCommit = rep.getCommit(toRevisionId);
            if (toCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + toRevisionId);
            }

            Commit fromCommit;
            if (toRevisionId.equals(fromRevisionId)) {
                fromCommit = toCommit;
            } else {
                fromCommit = rep.getCommit(fromRevisionId);
                if (fromCommit.getCommitTS() > toCommit.getCommitTS()) {
                    // negative range, return empty journal
                    return "[]";
                }
            }
            if (fromCommit.getBranchRootId() != null) {
                throw new MicroKernelException("branch revisions are not supported: " + fromRevisionId);
            }

            // collect commits, starting with toRevisionId
            // and traversing parent commit links until we've reached
            // fromRevisionId
            StoredCommit commit = toCommit;
            while (commit != null) {
                commits.add(commit);
                if (commit.getId().equals(fromRevisionId)) {
                    break;
                }
                Id commitId = commit.getParentId();
                if (commitId == null) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
                commit = rep.getCommit(commitId);
                if (commit.getCommitTS() < fromCommit.getCommitTS()) {
                    // inconsistent revision history, ignore silently...
                    break;
                }
            }
        } catch (MicroKernelException e) {
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        instructions.add(new AddNodeInstructionImpl("/a", "c"));
        instructions.add(new AddPropertyInstructionImpl("/a", "int", 1));
        instructions.add(new AddPropertyInstructionImpl("/a/b", "string", "foo"));
        instructions.add(new AddPropertyInstructionImpl("/a/c", "bool", true));

        Commit commit = new CommitImpl("/",
                "+a : { \"int\" : 1 , \"b\" : { \"string\" : \"foo\" } , \"c\" : { \"bool\" : true } } }",
                "This is the simple node scenario with nodes /, /a, /a/b, /a/c", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    public String addChildrenToA(int count) throws Exception {
        String revisionId = null;
        for (int i = 1; i <= count; i++) {
            List<Instruction> instructions = new LinkedList<Instruction>();
            instructions.add(new AddNodeInstructionImpl("/a", "child" + i));
            Commit commit = new CommitImpl("/a", "TODO", "Add child" + i, instructions);
            CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
            revisionId = command.execute();
        }
        return revisionId;
    }
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

     */
    public String delete_A() throws Exception {
        List<Instruction> instructions = new LinkedList<Instruction>();
        instructions.add(new RemoveNodeInstructionImpl("/", "a"));

        Commit commit = new CommitImpl("/", "-a", "This is a commit with deleted /a",
                instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();

        return revisionId;
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    }

    public String delete_B() throws Exception {
        List<Instruction> instructions = new LinkedList<Instruction>();
        instructions.add(new RemoveNodeInstructionImpl("/a", "b"));
        Commit commit = new CommitImpl("/a", "-b", "This is a commit with deleted /a/b",
                instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        return command.execute();
    }
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        instructions.add(new AddPropertyInstructionImpl("/a", "double", 0.123D));
        instructions.add(new AddPropertyInstructionImpl("/a/d", "null", null));
        instructions.add(new AddPropertyInstructionImpl("/a/b/e", "array", new Object[] { 123, null, 123.456D,
                "for:bar", Boolean.TRUE }));

        Commit commit = new CommitImpl("", "TODO", "This is a commit with updated /a and added /a/d and /a/b/e",
                instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();

        return revisionId;
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    @Test
    public void testSimpleSet() throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append("^\"a\" : \"b\"\n");

        Commit commit = this.buildAndAssertCommit(sb.toString());

        List<Instruction> instructions = commit.getInstructions();
        assertEquals(1, instructions.size());
        InstructionAssert.assertSetPropertyInstruction((SetPropertyInstruction) instructions.get(0), "/", "a", "b");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.