Mercurial > hg4j
diff src/org/tmatesoft/hg/core/HgDiffCommand.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 | a20121a2bba6 |
children | 7839ff0bfd78 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgDiffCommand.java Mon Jul 22 22:47:06 2013 +0200 +++ b/src/org/tmatesoft/hg/core/HgDiffCommand.java Wed Jul 24 16:40:15 2013 +0200 @@ -94,6 +94,20 @@ } /** + * Select range of file history, limited by changesets. + * @see #range(int, int) + * @param cset1 changelog revision, left range boundary + * @param cset2 changelog revision, right range boundary + * @return <code>this</code> for convenience + * @throws HgBadArgumentException if revisions are not valid changeset identifiers + */ + public HgDiffCommand range(Nodeid cset1, Nodeid cset2) throws HgBadArgumentException { + clogRevIndexStart.set(cset1); + clogRevIndexEnd.set(cset2); + return this; + } + + /** * Selects revision for {@link #executeParentsAnnotate(HgBlameInspector)}, the one * to diff against its parents. * @@ -109,6 +123,20 @@ clogRevIndexEnd.set(changelogRevIndex); return this; } + + /** + * Select specific changeset or a range [0..changeset], like {@link #changeset(int)} + * + * @param nid changeset + * @return <code>this</code> for convenience + * @throws HgBadArgumentException if failed to find supplied changeset revision + */ + public HgDiffCommand changeset(Nodeid nid) throws HgBadArgumentException { + clogRevIndexStart.set(0); + clogRevIndexEnd.set(nid); + return this; + } + /** * Revision differences are reported in selected order when