Examples of SVNDiffInstruction


Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

    private SVNDiffInstruction myInstructionTemplate;
   
    public SVNDeltaCombiner() {
        myRangeTree = new SVNRangeTree();
        myWindowInstructions = new SVNDiffInstruction[10];
        myInstructionTemplate = new SVNDiffInstruction(0,0,0);
        myOffsetsIndex = new SVNOffsetsIndex();
       
        myNextWindowData = ByteBuffer.allocate(2048);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

       
        SVNRangeTree rangeIndexTree = myRangeTree;
        rangeIndexTree.dispose();
   
        for(Iterator instructions = myWindow.instructions(true); instructions.hasNext();) {
            SVNDiffInstruction instruction = (SVNDiffInstruction) instructions.next();
            if (instruction.type != SVNDiffInstruction.COPY_FROM_SOURCE) {
                myNextWindowInstructions = ensureBufferSize(myNextWindowInstructions, 10);
                instruction.writeTo(myNextWindowInstructions);
                if (instruction.type == SVNDiffInstruction.COPY_FROM_NEW_DATA) {
                    myNextWindowData = ensureBufferSize(myNextWindowData, instruction.length);
                    myWindow.writeNewData(myNextWindowData, instruction.offset, instruction.length);
                }
            } else {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

    private void copySourceInstructions(int offset, int limit, int targetOffset, SVNDiffWindow window, SVNDiffInstruction[] windowInsructions) {
        int firstInstuctionIndex = findInstructionIndex(myOffsetsIndex, offset);
        int lastInstuctionIndex = findInstructionIndex(myOffsetsIndex, limit - 1);
       
        for(int i = firstInstuctionIndex; i <= lastInstuctionIndex; i++) {
            SVNDiffInstruction instruction = windowInsructions[i];
            int off0 = myOffsetsIndex.offsets[i];
            int off1 = myOffsetsIndex.offsets[i + 1];
           
            int fix_offset = offset > off0 ? offset - off0 : 0;
            int fix_limit = off1 > limit ? off1 - limit : 0;
            SVNDebugLog.assertCondition(SVNLogType.DEFAULT, fix_offset + fix_limit < instruction.length,
                    "assert #7");
           
            if (instruction.type != SVNDiffInstruction.COPY_FROM_TARGET) {
                int oldOffset = instruction.offset;
                int oldLength = instruction.length;
               
                instruction.offset += fix_offset;
                instruction.length = oldLength - fix_offset - fix_limit;
               
                myNextWindowInstructions = ensureBufferSize(myNextWindowInstructions, 10);
                instruction.writeTo(myNextWindowInstructions);
                if (instruction.type == SVNDiffInstruction.COPY_FROM_NEW_DATA) {
                    myNextWindowData = ensureBufferSize(myNextWindowData, instruction.length);
                    window.writeNewData(myNextWindowData, instruction.offset, instruction.length);
                }
                instruction.offset = oldOffset;
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

            myOffsetsIndex = new SVNOffsetsIndex();
        }
        myOffsetsIndex.clear();
        int offset = 0;
        for (int i = 0; i < length; i++) {
            SVNDiffInstruction instruction = instructions[i];
            myOffsetsIndex.addOffset(offset);
            offset += instruction.length;
        }
        myOffsetsIndex.addOffset(offset);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

    private SVNDiffInstruction myTemplateInstruction;
   
    public SVNDeltaAlgorithm() {
        myNewData = ByteBuffer.allocate(1024);
        myData = ByteBuffer.allocate(2048);
        myTemplateInstruction = new SVNDiffInstruction(0,0,0);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

    private SVNDiffInstruction myInstructionTemplate;
   
    public SVNDeltaCombiner() {
        myRangeTree = new SVNRangeTree();
        myWindowInstructions = new SVNDiffInstruction[10];
        myInstructionTemplate = new SVNDiffInstruction(0,0,0);
        myOffsetsIndex = new SVNOffsetsIndex();
       
        myNextWindowData = ByteBuffer.allocate(1024*20);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

       
        SVNRangeTree rangeIndexTree = myRangeTree;
        rangeIndexTree.dispose();
   
        for(Iterator instructions = myWindow.instructions(true); instructions.hasNext();) {
            SVNDiffInstruction instruction = (SVNDiffInstruction) instructions.next();
            if (instruction.type != SVNDiffInstruction.COPY_FROM_SOURCE) {
                myNextWindowInstructions = ensureBufferSize(myNextWindowInstructions, 10);
                instruction.writeTo(myNextWindowInstructions);
                if (instruction.type == SVNDiffInstruction.COPY_FROM_NEW_DATA) {
                    myNextWindowData = ensureBufferSize(myNextWindowData, instruction.length);
                    myWindow.writeNewData(myNextWindowData, instruction.offset, instruction.length);
                }
            } else {
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

    private void copySourceInstructions(int offset, int limit, int targetOffset, SVNDiffWindow window, SVNDiffInstruction[] windowInsructions) {
        int firstInstuctionIndex = findInstructionIndex(myOffsetsIndex, offset);
        int lastInstuctionIndex = findInstructionIndex(myOffsetsIndex, limit - 1);
       
        for(int i = firstInstuctionIndex; i <= lastInstuctionIndex; i++) {
            SVNDiffInstruction instruction = windowInsructions[i];
            int off0 = myOffsetsIndex.offsets[i];
            int off1 = myOffsetsIndex.offsets[i + 1];
           
            int fix_offset = offset > off0 ? offset - off0 : 0;
            int fix_limit = off1 > limit ? off1 - limit : 0;
            assertCondition(fix_offset + fix_limit < instruction.length, "assert #7");
           
            if (instruction.type != SVNDiffInstruction.COPY_FROM_TARGET) {
                int oldOffset = instruction.offset;
                int oldLength = instruction.length;
               
                instruction.offset += fix_offset;
                instruction.length = oldLength - fix_offset - fix_limit;
               
                myNextWindowInstructions = ensureBufferSize(myNextWindowInstructions, 10);
                instruction.writeTo(myNextWindowInstructions);
                if (instruction.type == SVNDiffInstruction.COPY_FROM_NEW_DATA) {
                    myNextWindowData = ensureBufferSize(myNextWindowData, instruction.length);
                    window.writeNewData(myNextWindowData, instruction.offset, instruction.length);
                }
                instruction.offset = oldOffset;
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

            myOffsetsIndex = new SVNOffsetsIndex();
        }
        myOffsetsIndex.clear();
        int offset = 0;
        for (int i = 0; i < length; i++) {
            SVNDiffInstruction instruction = instructions[i];
            myOffsetsIndex.addOffset(offset);
            offset += instruction.length;
        }
        myOffsetsIndex.addOffset(offset);
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.io.diff.SVNDiffInstruction

    private SVNDiffInstruction myTemplateInstruction;
   
    public SVNDeltaAlgorithm() {
        myNewData = ByteBuffer.allocate(1024);
        myData = ByteBuffer.allocate(2048);
        myTemplateInstruction = new SVNDiffInstruction(0,0,0);
    }
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.