Mercurial > hg4j
annotate src/org/tmatesoft/hg/core/HgChangesetHandler.java @ 514:5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 19:06:07 +0100 |
parents | 31a89587eb04 |
children | 6526d8adbc0f |
rev | line source |
---|---|
205
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 /* |
423
9c9c442b5f2e
Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
312
diff
changeset
|
2 * Copyright (c) 2011-2012 TMate Software Ltd |
205
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
3 * |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 * the Free Software Foundation; version 2 of the License. |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 * |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 * |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 * For information on how to redistribute this software under |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 * the terms of a license other than GNU General Public License |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 * contact TMate Software at support@hg4j.com |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 */ |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
17 package org.tmatesoft.hg.core; |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 |
423
9c9c442b5f2e
Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
312
diff
changeset
|
19 import org.tmatesoft.hg.internal.Callback; |
514
5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
427
diff
changeset
|
20 import org.tmatesoft.hg.util.Adaptable; |
427
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
21 import org.tmatesoft.hg.util.Path; |
312
f9f3e9b67ccc
Facilitate cancellation and progress reporting in changelog and manifest iterations
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
215
diff
changeset
|
22 |
205
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 /** |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 * Callback to process {@link HgChangeset changesets}. |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 * |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 * @author Artem Tikhomirov |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
27 * @author TMate Software Ltd. |
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 */ |
423
9c9c442b5f2e
Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
312
diff
changeset
|
29 @Callback |
427
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
30 public interface HgChangesetHandler { |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
31 |
205
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 /** |
427
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
33 * @param changeset descriptor of a change, not necessarily a distinct instance each time, {@link HgChangeset#clone() clone()} if need a copy. |
423
9c9c442b5f2e
Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
312
diff
changeset
|
34 * @throws HgCallbackTargetException wrapper for any exception user code may produce |
205
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
35 */ |
427
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
36 void cset(HgChangeset changeset) throws HgCallbackTargetException; |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
37 |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
38 |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
39 /** |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
40 * When {@link HgLogCommand} is executed against file, handler passed to {@link HgLogCommand#execute(HgChangesetHandler)} may optionally |
514
5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
427
diff
changeset
|
41 * implement this interface (or make it available through {@link Adaptable#getAdapter(Class)} to get information about file renames. |
5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
427
diff
changeset
|
42 * Method {@link #copy(HgFileRevision, HgFileRevision)} would get invoked prior any changeset of the original file |
5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
427
diff
changeset
|
43 * (if file history being followed) is reported via {@link #cset(HgChangeset)}. |
427
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
44 * |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
45 * For {@link HgLogCommand#file(Path, boolean)} with renamed file path and follow argument set to false, |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
46 * {@link #copy(HgFileRevision, HgFileRevision)} would be invoked for the first copy/rename in the history of the file, but not |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
47 * followed by any changesets. |
514
5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
427
diff
changeset
|
48 * |
5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
427
diff
changeset
|
49 * @see HgFileRenameHandlerMixin |
427
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
50 */ |
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
51 @Callback |
514
5dcb4581c8ef
Report renames when following file history tree with HgFileRenameHandlerMixin
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
427
diff
changeset
|
52 public interface WithCopyHistory extends HgChangesetHandler, HgFileRenameHandlerMixin { |
427
31a89587eb04
FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
423
diff
changeset
|
53 } |
205
ffc5f6d59f7e
HgLogCommand.Handler is used in few places, pull up to top-level class, HgChangesetHandler
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
54 } |