diff src/org/tmatesoft/hg/internal/ForwardAnnotateInspector.java @ 686:f1f095e42555

Annotated file is not always changed in the latest changeset, need to find out last changest it was changed at (iow, diffed to with BlameHelper)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 25 Jul 2013 22:12:14 +0200
parents 58a6900f845d
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/ForwardAnnotateInspector.java	Thu Jul 25 21:32:09 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/ForwardAnnotateInspector.java	Thu Jul 25 22:12:14 2013 +0200
@@ -29,7 +29,7 @@
  * 
  * At the moment, doesn't handle start from any revision but 0
  * 
- * (+) May report annotate for any revision in the visited range.
+ * (+) May report annotate for any revision (with actual file change) in the visited range.
  * 
  * @see ReverseAnnotateInspector
  * @author Artem Tikhomirov
@@ -51,6 +51,9 @@
 
 	public void report(int revision, Inspector insp, ProgressSupport progress, CancelSupport cancel) throws HgCallbackTargetException, CancelledException {
 		int totalLines = 0;
+		if (!all.containsKey(revision)) {
+			throw new IllegalArgumentException(String.format("Revision %d has not been visited", revision));
+		}
 		for (IntTuple t : all.get(revision)) {
 			totalLines += t.at(0);
 		}