Mercurial > jhg
comparison src/org/tmatesoft/hg/core/HgLogCommand.java @ 367:2fadf8695f8a
Use 'revision index' instead of the vague 'local revision number' concept in the API
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 16 Dec 2011 15:37:27 +0100 |
parents | 189dc6dc1c3e |
children | 8107b95f4280 |
comparison
equal
deleted
inserted
replaced
366:189dc6dc1c3e | 367:2fadf8695f8a |
---|---|
130 } | 130 } |
131 | 131 |
132 /** | 132 /** |
133 * Limit to specified subset of Changelog, [min(rev1,rev2), max(rev1,rev2)], inclusive. | 133 * Limit to specified subset of Changelog, [min(rev1,rev2), max(rev1,rev2)], inclusive. |
134 * Revision may be specified with {@link HgRepository#TIP} | 134 * Revision may be specified with {@link HgRepository#TIP} |
135 * @param rev1 - local revision number | 135 * @param rev1 - local revision index |
136 * @param rev2 - local revision number | 136 * @param rev2 - local revision index |
137 * @return <code>this</code> instance for convenience | 137 * @return <code>this</code> instance for convenience |
138 */ | 138 */ |
139 public HgLogCommand range(int rev1, int rev2) { | 139 public HgLogCommand range(int rev1, int rev2) { |
140 if (rev1 != TIP && rev2 != TIP) { | 140 if (rev1 != TIP && rev2 != TIP) { |
141 startRev = rev2 < rev1 ? rev2 : rev1; | 141 startRev = rev2 < rev1 ? rev2 : rev1; |
158 * @throws HgInvalidRevisionException if supplied nodeid doesn't identify any revision from this revlog | 158 * @throws HgInvalidRevisionException if supplied nodeid doesn't identify any revision from this revlog |
159 * @throws HgInvalidControlFileException if access to revlog index/data entry failed | 159 * @throws HgInvalidControlFileException if access to revlog index/data entry failed |
160 */ | 160 */ |
161 public HgLogCommand changeset(Nodeid nid) throws HgInvalidControlFileException, HgInvalidRevisionException { | 161 public HgLogCommand changeset(Nodeid nid) throws HgInvalidControlFileException, HgInvalidRevisionException { |
162 // XXX perhaps, shall support multiple (...) arguments and extend #execute to handle not only range, but also set of revisions. | 162 // XXX perhaps, shall support multiple (...) arguments and extend #execute to handle not only range, but also set of revisions. |
163 final int csetLocal = repo.getChangelog().getLocalRevision(nid); | 163 final int csetLocal = repo.getChangelog().getRevisionIndex(nid); |
164 return range(csetLocal, csetLocal); | 164 return range(csetLocal, csetLocal); |
165 } | 165 } |
166 | 166 |
167 /** | 167 /** |
168 * Visit history of a given file only. | 168 * Visit history of a given file only. |