comparison src/org/tmatesoft/hg/internal/Patch.java @ 530:0f6fa88e2162

Towards commit command: refactor clone, extract pieces to reuse. Describe a defect discovered when bundle has few patches with 0,0 parents
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 23 Jan 2013 17:46:12 +0100
parents 6c22bdc0bdfd
children 688c1ab113bb
comparison
equal deleted inserted replaced
529:95bdcf75e71e 530:0f6fa88e2162
112 // copy source bytes that were not modified (up to start of the record) 112 // copy source bytes that were not modified (up to start of the record)
113 baseRevisionContent.readBytes(rv, destIndex, start - prevEnd); 113 baseRevisionContent.readBytes(rv, destIndex, start - prevEnd);
114 destIndex += start - prevEnd; 114 destIndex += start - prevEnd;
115 // insert new data from the patch, if any 115 // insert new data from the patch, if any
116 byte[] d = data.get(i); 116 byte[] d = data.get(i);
117 System.arraycopy(d, 0, rv, destIndex, d.length); 117 try {
118 System.arraycopy(d, 0, rv, destIndex, d.length);
119 } catch (ArrayIndexOutOfBoundsException ex) {
120 ex.printStackTrace();
121 }
118 destIndex += d.length; 122 destIndex += d.length;
119 prevEnd = ends.get(i); 123 prevEnd = ends.get(i);
120 } 124 }
121 baseRevisionContent.seek(prevEnd); 125 baseRevisionContent.seek(prevEnd);
122 // copy everything in the source past last record's end 126 // copy everything in the source past last record's end