diff src/org/tmatesoft/hg/core/HgLogCommand.java @ 559:6ca3d0c5b4bc

Commit: tests and fixes for defects discovered
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 25 Feb 2013 19:48:20 +0100
parents f7fbf48b9383
children 78a9e26e670d
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgLogCommand.java	Mon Feb 25 18:41:44 2013 +0100
+++ b/src/org/tmatesoft/hg/core/HgLogCommand.java	Mon Feb 25 19:48:20 2013 +0100
@@ -298,10 +298,13 @@
 		if (csetTransform != null) {
 			throw new ConcurrentModificationException();
 		}
+		if (repo.getChangelog().getRevisionCount() == 0) {
+			return;
+		}
 		final int lastCset = endRev == TIP ? repo.getChangelog().getLastRevision() : endRev;
 		// XXX pretty much like HgInternals.checkRevlogRange
 		if (lastCset < 0 || lastCset > repo.getChangelog().getLastRevision()) {
-			throw new HgBadArgumentException(String.format("Bad value %d for end revision", endRev), null);
+			throw new HgBadArgumentException(String.format("Bad value %d for end revision", lastCset), null);
 		}
 		if (startRev < 0 || startRev > lastCset) {
 			throw new HgBadArgumentException(String.format("Bad value %d for start revision for range [%1$d..%d]", startRev, lastCset), null);