diff src/org/tmatesoft/hg/core/HgInvalidRevisionException.java @ 405:866fc3b597a0

Add an explicit constant instead of -1 to indicate 'no revision' case
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 14 Mar 2012 22:49:32 +0100
parents 0ae53c32ecef
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgInvalidRevisionException.java	Mon Mar 05 14:50:51 2012 +0100
+++ b/src/org/tmatesoft/hg/core/HgInvalidRevisionException.java	Wed Mar 14 22:49:32 2012 +0100
@@ -32,7 +32,7 @@
 	private Nodeid rev;
 	private Integer revIdx = BAD_REVISION;
 	// next two make sense only when revIdx is present
-	private int rangeLeftBoundary = -1, rangeRightBoundary = -1;
+	private int rangeLeftBoundary = BAD_REVISION, rangeRightBoundary = BAD_REVISION;
 
 	/**
 	 * 
@@ -110,9 +110,10 @@
 			case BAD_REVISION : sr = "UNKNOWN"; break;
 			case TIP : sr = "TIP"; break;
 			case WORKING_COPY: sr = "WORKING-COPY"; break;
+			case NO_REVISION : sr = "NO REVISION"; break;
 			default : sr = revIdx.toString();
 			}
-			if (rangeLeftBoundary != -1 || rangeRightBoundary != -1) {
+			if (rangeLeftBoundary != BAD_REVISION || rangeRightBoundary != BAD_REVISION) {
 				sb.append(String.format("%s is not from [%d..%d]", sr, rangeLeftBoundary, rangeRightBoundary));
 			} else {
 				sb.append(sr);