Mercurial > hg4j
diff src/org/tmatesoft/hg/repo/HgInternals.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 | 2747b0723867 |
children | bb278ccf9866 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgInternals.java Mon Mar 05 14:50:51 2012 +0100 +++ b/src/org/tmatesoft/hg/repo/HgInternals.java Wed Mar 14 22:49:32 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 TMate Software Ltd + * Copyright (c) 2011-2012 TMate Software Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -137,7 +137,7 @@ // Convenient check of revision index for validity (not all negative values are wrong as long as we use negative constants) public static boolean wrongRevisionIndex(int rev) { // FIXME guess, usages shall throw HgInvalidRevision. \ // TODO Another method to check,throw and expand TIP at once - return rev < 0 && rev != TIP && rev != WORKING_COPY && rev != BAD_REVISION; + return rev < 0 && rev != TIP && rev != WORKING_COPY && rev != BAD_REVISION && rev != NO_REVISION; } // throws HgInvalidRevisionException or IllegalArgumentException if [start..end] range is not a subrange of [0..lastRevision]