comparison src/org/tmatesoft/hg/core/HgChangesetHandler.java @ 427:31a89587eb04

FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 29 Mar 2012 17:14:35 +0200
parents 9c9c442b5f2e
children 5dcb4581c8ef
comparison
equal deleted inserted replaced
426:063b0663495a 427:31a89587eb04
15 * contact TMate Software at support@hg4j.com 15 * contact TMate Software at support@hg4j.com
16 */ 16 */
17 package org.tmatesoft.hg.core; 17 package org.tmatesoft.hg.core;
18 18
19 import org.tmatesoft.hg.internal.Callback; 19 import org.tmatesoft.hg.internal.Callback;
20 import org.tmatesoft.hg.util.CancelledException; 20 import org.tmatesoft.hg.util.Path;
21 21
22 /** 22 /**
23 * Callback to process {@link HgChangeset changesets}. 23 * Callback to process {@link HgChangeset changesets}.
24 * 24 *
25 * @author Artem Tikhomirov 25 * @author Artem Tikhomirov
26 * @author TMate Software Ltd. 26 * @author TMate Software Ltd.
27 */ 27 */
28 @Callback 28 @Callback
29 public interface HgChangesetHandler/*XXX perhaps, shall parameterize with exception clients can throw, like: <E extends Exception>*/ { 29 public interface HgChangesetHandler {
30
30 /** 31 /**
31 * @param changeset not necessarily a distinct instance each time, {@link HgChangeset#clone() clone()} if need a copy. 32 * @param changeset descriptor of a change, not necessarily a distinct instance each time, {@link HgChangeset#clone() clone()} if need a copy.
32 * @throws HgCallbackTargetException wrapper for any exception user code may produce 33 * @throws HgCallbackTargetException wrapper for any exception user code may produce
33 * @throws CancelledException if handler is not interested in more changesets and iteration shall stop
34 */ 34 */
35 void next(HgChangeset changeset) throws HgCallbackTargetException, CancelledException; 35 void cset(HgChangeset changeset) throws HgCallbackTargetException;
36
37
38 /**
39 * When {@link HgLogCommand} is executed against file, handler passed to {@link HgLogCommand#execute(HgChangesetHandler)} may optionally
40 * implement this interface to get information about file renames. Method {@link #copy(HgFileRevision, HgFileRevision)} would
41 * get invoked prior any changeset of the original file (if file history being followed) is reported via {@link #cset(HgChangeset)}.
42 *
43 * For {@link HgLogCommand#file(Path, boolean)} with renamed file path and follow argument set to false,
44 * {@link #copy(HgFileRevision, HgFileRevision)} would be invoked for the first copy/rename in the history of the file, but not
45 * followed by any changesets.
46 */
47 @Callback
48 public interface WithCopyHistory extends HgChangesetHandler {
49 // XXX perhaps, should distinguish copy from rename? And what about merged revisions and following them?
50
51 /**
52 * @throws HgCallbackTargetException wrapper object for any exception user code may produce
53 */
54 void copy(HgFileRevision from, HgFileRevision to) throws HgCallbackTargetException;
55 }
36 } 56 }