Mercurial > hg4j
comparison src/org/tmatesoft/hg/core/HgChangesetTreeHandler.java @ 328:a674b8590362
Move file tree history to upper API level
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 05 Oct 2011 07:13:57 +0200 |
parents | |
children | 189dc6dc1c3e |
comparison
equal
deleted
inserted
replaced
327:3f09b8c19142 | 328:a674b8590362 |
---|---|
1 /* | |
2 * Copyright (c) 2011 TMate Software Ltd | |
3 * | |
4 * This program is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; version 2 of the License. | |
7 * | |
8 * This program is distributed in the hope that it will be useful, | |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 * GNU General Public License for more details. | |
12 * | |
13 * For information on how to redistribute this software under | |
14 * the terms of a license other than GNU General Public License | |
15 * contact TMate Software at support@hg4j.com | |
16 */ | |
17 package org.tmatesoft.hg.core; | |
18 | |
19 import java.util.Collection; | |
20 | |
21 import org.tmatesoft.hg.util.CancelledException; | |
22 import org.tmatesoft.hg.util.Pair; | |
23 | |
24 /** | |
25 * | |
26 * @author Artem Tikhomirov | |
27 * @author TMate Software Ltd. | |
28 */ | |
29 public interface HgChangesetTreeHandler { | |
30 /** | |
31 * @param entry access to various pieces of information about current tree node. Instances might be | |
32 * reused across calls and shall not be kept by client's code | |
33 */ | |
34 public void next(HgChangesetTreeHandler.TreeElement entry) throws CancelledException; | |
35 | |
36 interface TreeElement { | |
37 /** | |
38 * Revision of the revlog being iterated. For example, when walking file history, return value represents file revisions. | |
39 * | |
40 * @return revision of the revlog being iterated. | |
41 */ | |
42 public Nodeid fileRevision(); | |
43 /** | |
44 * @return changeset associated with the current revision | |
45 */ | |
46 public HgChangeset changeset(); | |
47 | |
48 /** | |
49 * Lightweight alternative to {@link #changeset()}, identifies changeset in which current file node has been modified | |
50 * @return changeset {@link Nodeid} | |
51 */ | |
52 public Nodeid changesetRevision(); | |
53 | |
54 /** | |
55 * Node, these are not necessarily in direct relation to parents of changeset from {@link #changeset()} | |
56 * @return changesets that correspond to parents of the current file node, either pair element may be <code>null</code>. | |
57 */ | |
58 public Pair<HgChangeset, HgChangeset> parents(); | |
59 | |
60 /** | |
61 * Lightweight alternative to {@link #parents()}, give {@link Nodeid nodeids} only | |
62 * @return two values, neither is <code>null</code>, use {@link Nodeid#isNull()} to identify parent not set | |
63 */ | |
64 public Pair<Nodeid, Nodeid> parentRevisions(); | |
65 | |
66 public Collection<HgChangeset> children(); | |
67 | |
68 /** | |
69 * Lightweight alternative to {@link #children()}. | |
70 * @return never <code>null</code> | |
71 */ | |
72 public Collection<Nodeid> childRevisions(); | |
73 } | |
74 } |