diff src/org/tmatesoft/hg/core/HgDiffCommand.java @ 675:a20121a2bba6

Respect default range (0..tip)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 18 Jul 2013 18:02:36 +0200
parents 54e16ab771ec
children 98ff1fb49abe
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgDiffCommand.java	Wed Jul 17 15:40:51 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgDiffCommand.java	Thu Jul 18 18:02:36 2013 +0200
@@ -139,14 +139,16 @@
 		final ProgressSupport progress = getProgressSupport(insp);
 		progress.start(2);
 		try {
+			final int startRevIndex = clogRevIndexStart.get(0);
+			final int endRevIndex = clogRevIndexEnd.get(TIP);
 			final CancelSupport cancel = getCancelSupport(insp, true);
-			int fileRevIndex1 = fileRevIndex(df, clogRevIndexStart.get());
-			int fileRevIndex2 = fileRevIndex(df, clogRevIndexEnd.get());
+			int fileRevIndex1 = fileRevIndex(df, startRevIndex);
+			int fileRevIndex2 = fileRevIndex(df, endRevIndex);
 			BlameHelper bh = new BlameHelper(insp);
-			bh.prepare(df, clogRevIndexStart.get(), clogRevIndexEnd.get());
+			bh.prepare(df, startRevIndex, endRevIndex);
 			progress.worked(1);
 			cancel.checkCancelled();
-			bh.diff(fileRevIndex1, clogRevIndexStart.get(), fileRevIndex2, clogRevIndexEnd.get());
+			bh.diff(fileRevIndex1, startRevIndex, fileRevIndex2, endRevIndex);
 			progress.worked(1);
 			cancel.checkCancelled();
 		} catch (HgRuntimeException ex) {
@@ -172,7 +174,9 @@
 			}
 			final CancelSupport cancel = getCancelSupport(insp, true);
 			BlameHelper bh = new BlameHelper(insp);
-			FileHistory fileHistory = bh.prepare(df, clogRevIndexStart.get(), clogRevIndexEnd.get());
+			final int startRevIndex = clogRevIndexStart.get(0);
+			final int endRevIndex = clogRevIndexEnd.get(TIP);
+			FileHistory fileHistory = bh.prepare(df, startRevIndex, endRevIndex);
 			//
 			cancel.checkCancelled();
 			int totalWork = 0;
@@ -189,8 +193,8 @@
 				for (int fri : fhc.fileRevisions(iterateDirection)) {
 					int clogRevIndex = fhc.changeset(fri);
 					// the way we built fileHistory ensures we won't walk past [changelogRevIndexStart..changelogRevIndexEnd]
-					assert clogRevIndex >= clogRevIndexStart.get();
-					assert clogRevIndex <= clogRevIndexEnd.get();
+					assert clogRevIndex >= startRevIndex;
+					assert clogRevIndex <= endRevIndex;
 					fhc.fillFileParents(fri, fileParentRevs);
 					fhc.fillCsetParents(fri, fileClogParentRevs);
 					bh.annotateChange(fri, clogRevIndex, fileParentRevs, fileClogParentRevs);