Mercurial > hg4j
diff src/org/tmatesoft/hg/core/HgLogCommand.java @ 683:98ff1fb49abe
Update commands to use changeset Nodeid and int in uniform way, clients of core.* classes shall not go back and forth from int to Nodeid
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 24 Jul 2013 16:40:15 +0200 |
parents | 6526d8adbc0f |
children | e970b333f284 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgLogCommand.java Mon Jul 22 22:47:06 2013 +0200 +++ b/src/org/tmatesoft/hg/core/HgLogCommand.java Wed Jul 24 16:40:15 2013 +0200 @@ -180,6 +180,34 @@ } /** + * Limit history to specified range. + * + * @see #range(int, int) + * @param cset1 range start revision + * @param cset2 range end revision + * @return <code>this</code> instance for convenience + * @throws HgBadArgumentException if revisions are not valid changeset identifiers + */ + public HgLogCommand range(Nodeid cset1, Nodeid cset2) throws HgBadArgumentException { + CsetParamKeeper pk = new CsetParamKeeper(repo); + int r1 = pk.set(cset1).get(); + int r2 = pk.set(cset2).get(); + return range(r1, r2); + } + + /** + * Select specific changeset by index + * @see #changeset(Nodeid) + * @param revisionIndex index of changelog revision + * @return <code>this</code> for convenience + * @throws HgBadArgumentException if failed to find supplied changeset revision + */ + public HgLogCommand changeset(int revisionIndex) throws HgBadArgumentException { + int ri = new CsetParamKeeper(repo).set(revisionIndex).get(); + return range(ri, ri); + } + + /** * Select specific changeset * * @param nid changeset revision