comparison src/org/tmatesoft/hg/internal/CsetParamKeeper.java @ 675:a20121a2bba6

Respect default range (0..tip)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 18 Jul 2013 18:02:36 +0200
parents 6526d8adbc0f
children
comparison
equal deleted inserted replaced
674:cce0387c6041 675:a20121a2bba6
81 * @param defaultRevisionIndex value to return when no revision was set, may be {@link HgRepository#TIP} which gets translated to real index if used 81 * @param defaultRevisionIndex value to return when no revision was set, may be {@link HgRepository#TIP} which gets translated to real index if used
82 * @return changelog revision index if set, or defaultRevisionIndex value otherwise 82 * @return changelog revision index if set, or defaultRevisionIndex value otherwise
83 */ 83 */
84 public int get(int defaultRevisionIndex) throws HgRuntimeException { 84 public int get(int defaultRevisionIndex) throws HgRuntimeException {
85 // XXX perhaps, shall translate other predefined constants (like WORKING COPY) here, too (e.g. for HgRevertCommand) 85 // XXX perhaps, shall translate other predefined constants (like WORKING COPY) here, too (e.g. for HgRevertCommand)
86 if (changelogRevisionIndex != BAD_REVISION || changelogRevisionIndex != TIP) { 86 if (changelogRevisionIndex != BAD_REVISION && changelogRevisionIndex != TIP) {
87 return changelogRevisionIndex; 87 return changelogRevisionIndex;
88 } 88 }
89 if (changelogRevisionIndex == TIP || defaultRevisionIndex == TIP) { 89 if (changelogRevisionIndex == TIP || defaultRevisionIndex == TIP) {
90 return repo.getChangelog().getLastRevision(); 90 return repo.getChangelog().getLastRevision();
91 } 91 }