Mercurial > hg4j
comparison src/org/tmatesoft/hg/internal/diff/ForwardAnnotateInspector.java @ 709:497e697636fc
Report merged lines as changed block if possible, not as a sequence of added/deleted blocks. To facilitate access to merge parent lines AddBlock got mergeLineAt() method that reports index of the line in the second parent (if any), while insertedAt() has been changed to report index in the first parent always
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 21 Aug 2013 16:23:27 +0200 |
parents | 7839ff0bfd78 |
children |
comparison
equal
deleted
inserted
replaced
708:4ffc17c0b534 | 709:497e697636fc |
---|---|
90 copyBlock(block.originChangesetIndex(), block.originStart(), block.length()); | 90 copyBlock(block.originChangesetIndex(), block.originStart(), block.length()); |
91 } | 91 } |
92 | 92 |
93 public void added(AddBlock block) throws HgCallbackTargetException { | 93 public void added(AddBlock block) throws HgCallbackTargetException { |
94 if (revDescriptor.isMerge() && block.originChangesetIndex() == revDescriptor.mergeChangesetIndex()) { | 94 if (revDescriptor.isMerge() && block.originChangesetIndex() == revDescriptor.mergeChangesetIndex()) { |
95 copyBlock(block.originChangesetIndex(), block.insertedAt(), block.totalAddedLines()); | 95 assert block.mergeLineAt() != -1; |
96 copyBlock(block.originChangesetIndex(), block.mergeLineAt(), block.totalAddedLines()); | |
96 return; | 97 return; |
97 } | 98 } |
98 BlockData addedLines = block.addedLines(); | 99 BlockData addedLines = block.addedLines(); |
99 IntMap<byte[]> revLines = lineContent.get(block.targetChangesetIndex()); | 100 IntMap<byte[]> revLines = lineContent.get(block.targetChangesetIndex()); |
100 if (revLines == null) { | 101 if (revLines == null) { |