diff src/org/tmatesoft/hg/internal/PatchGenerator.java @ 543:1e95f48d9886

Report line index for insertion and deletion, test against 'hg diff' output
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 15 Feb 2013 15:52:03 +0100
parents a71a05ec11bc
children 7f5998a9619d
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/PatchGenerator.java	Thu Feb 14 16:36:13 2013 +0100
+++ b/src/org/tmatesoft/hg/internal/PatchGenerator.java	Fri Feb 15 15:52:03 2013 +0100
@@ -187,7 +187,7 @@
 					changed(changeStartS1, matchStartSeq1, changeStartS2, matchStartSeq2);
 				} else {
 					assert changeStartS2 == matchStartSeq2;
-					deleted(changeStartS1, matchStartSeq1);
+					deleted(matchStartSeq2, changeStartS1, matchStartSeq1);
 				}
 			} else {
 				assert changeStartS1 == matchStartSeq1;
@@ -210,7 +210,7 @@
 			// NO-OP
 		}
 
-		protected void deleted(int s1From, int s1To) {
+		protected void deleted(int s2DeletePoint, int s1From, int s1To) {
 			// NO-OP
 		}
 
@@ -231,7 +231,7 @@
 		}
 		
 		@Override
-		protected void deleted(int s1From, int s1To) {
+		protected void deleted(int s2DeletionPoint, int s1From, int s1To) {
 			System.out.printf("deleted [%d..%d)\n", s1From, s1To);
 		}
 		
@@ -259,7 +259,7 @@
 		}
 		
 		@Override
-		protected void deleted(int s1From, int s1To) {
+		protected void deleted(int s2DeletionPoint, int s1From, int s1To) {
 			int from = seq1.chunk(s1From).getOffset();
 			int to = seq1.chunk(s1To).getOffset();
 			deltaCollector.add(from, to, new byte[0]);