diff src/org/tmatesoft/hg/internal/ChangelogHelper.java @ 354:5f9073eabf06

Propagate errors with exceptions up to a end client
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 01 Dec 2011 05:21:40 +0100
parents f052f40839ec
children 2fadf8695f8a
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/ChangelogHelper.java	Thu Dec 01 03:05:28 2011 +0100
+++ b/src/org/tmatesoft/hg/internal/ChangelogHelper.java	Thu Dec 01 05:21:40 2011 +0100
@@ -18,6 +18,7 @@
 
 import java.util.TreeMap;
 
+import org.tmatesoft.hg.core.HgInvalidControlFileException;
 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset;
 import org.tmatesoft.hg.repo.HgDataFile;
 import org.tmatesoft.hg.repo.HgInternals;
@@ -32,7 +33,7 @@
 public class ChangelogHelper {
 	private final int leftBoundary;
 	private final HgRepository repo;
-	private final TreeMap<Integer, RawChangeset> cache = new TreeMap<Integer, RawChangeset>();
+	private final TreeMap<Integer, RawChangeset> cache = new TreeMap<Integer, RawChangeset>(); // FIXME use IntMap instead
 	private String nextCommitAuthor;
 
 	/**
@@ -55,10 +56,9 @@
 	/**
 	 * Walks changelog in reverse order
 	 * @param file
-	 * @return changeset where specified file is mentioned among affected files, or 
-	 * <code>null</code> if none found up to leftBoundary 
+	 * @return changeset where specified file is mentioned among affected files, or <code>null</code> if none found up to leftBoundary
 	 */
-	public RawChangeset findLatestChangeWith(Path file) {
+	public RawChangeset findLatestChangeWith(Path file) throws HgInvalidControlFileException {
 		HgDataFile df = repo.getFileNode(file);
 		if (!df.exists()) {
 			return null;