comparison src/org/tmatesoft/hg/internal/DiffHelper.java @ 624:507602cb4fb3

FIXMEs and TODOs: pay some technical debt
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 20 May 2013 20:34:33 +0200
parents 47dfa0ec7e35
children 58a6900f845d
comparison
equal deleted inserted replaced
623:fedc54356091 624:507602cb4fb3
18 18
19 import java.util.ArrayList; 19 import java.util.ArrayList;
20 import java.util.HashMap; 20 import java.util.HashMap;
21 import java.util.Map; 21 import java.util.Map;
22 22
23 import org.tmatesoft.hg.repo.HgInvalidStateException;
24
25 /** 23 /**
26 * Mercurial cares about changes only up to the line level, e.g. a simple file version dump in manifest looks like (RevlogDump output): 24 * Mercurial cares about changes only up to the line level, e.g. a simple file version dump in manifest looks like (RevlogDump output):
27 * 25 *
28 * 522: 233748 0 103 17438 433 522 521 -1 756073cf2321df44d3ed0585f2a5754bc8a1b2f6 26 * 522: 233748 0 103 17438 433 522 521 -1 756073cf2321df44d3ed0585f2a5754bc8a1b2f6
29 * <PATCH>: 27 * <PATCH>:
199 if(changeStartS2 < matchStartSeq2) { 197 if(changeStartS2 < matchStartSeq2) {
200 added(changeStartS1, changeStartS2, matchStartSeq2); 198 added(changeStartS1, changeStartS2, matchStartSeq2);
201 } else { 199 } else {
202 assert changeStartS2 == matchStartSeq2; 200 assert changeStartS2 == matchStartSeq2;
203 if (matchStartSeq1 > 0 || matchStartSeq2 > 0) { 201 if (matchStartSeq1 > 0 || matchStartSeq2 > 0) {
204 // FIXME perhaps, exception is too much for the case 202 assert false : String.format("adjustent equal blocks %d, %d and %d,%d", changeStartS1, matchStartSeq1, changeStartS2, matchStartSeq2);
205 // once diff is covered with tests, replace with assert false : msg;
206 throw new HgInvalidStateException(String.format("adjustent equal blocks %d, %d and %d,%d", changeStartS1, matchStartSeq1, changeStartS2, matchStartSeq2));
207 } 203 }
208 } 204 }
209 } 205 }
210 if (matchLength > 0) { 206 if (matchLength > 0) {
211 unchanged(matchStartSeq1, matchStartSeq2, matchLength); 207 unchanged(matchStartSeq1, matchStartSeq2, matchLength);