Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/ManifestRevision.java @ 537:5a455624be4f
Update javadoc for HgManifest.Inspector and fix erroneous internal API
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 05 Feb 2013 20:06:22 +0100 |
parents | 12f668401613 |
children | dd4f6311af52 |
comparison
equal
deleted
inserted
replaced
536:2813a26b8999 | 537:5a455624be4f |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011-2012 TMate Software Ltd | 2 * Copyright (c) 2011-2013 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 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 | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
24 import org.tmatesoft.hg.util.Convertor; | 24 import org.tmatesoft.hg.util.Convertor; |
25 import org.tmatesoft.hg.util.Path; | 25 import org.tmatesoft.hg.util.Path; |
26 | 26 |
27 /** | 27 /** |
28 * Specific revision of the manifest. | 28 * Specific revision of the manifest. |
29 * Note, suited to keep single revision only ({@link #changeset()}). | 29 * Note, suited to keep single revision only ({@link #revision()}), which is linked to changeset {@link #changesetRevisionIndex()}. |
30 * | 30 * |
31 * @author Artem Tikhomirov | 31 * @author Artem Tikhomirov |
32 * @author TMate Software Ltd. | 32 * @author TMate Software Ltd. |
33 */ | 33 */ |
34 public final class ManifestRevision implements HgManifest.Inspector { | 34 public final class ManifestRevision implements HgManifest.Inspector { |
35 private final TreeMap<Path, Nodeid> idsMap; | 35 private final TreeMap<Path, Nodeid> idsMap; |
36 private final TreeMap<Path, HgManifest.Flags> flagsMap; | 36 private final TreeMap<Path, HgManifest.Flags> flagsMap; |
37 private final Convertor<Nodeid> idsPool; | 37 private final Convertor<Nodeid> idsPool; |
38 private final Convertor<Path> namesPool; | 38 private final Convertor<Path> namesPool; |
39 private Nodeid changeset; | 39 private Nodeid manifestRev; |
40 private int changelogRev; | 40 private int changelogRevIndex, manifestRevIndex; |
41 | 41 |
42 // optional pools for effective management of nodeids and filenames (they are likely | 42 // optional pools for effective management of nodeids and filenames (they are likely |
43 // to be duplicated among different manifest revisions | 43 // to be duplicated among different manifest revisions |
44 public ManifestRevision(Pool<Nodeid> nodeidPool, Convertor<Path> filenamePool) { | 44 public ManifestRevision(Pool<Nodeid> nodeidPool, Convertor<Path> filenamePool) { |
45 idsPool = nodeidPool; | 45 idsPool = nodeidPool; |
60 HgManifest.Flags f = flagsMap.get(fname); | 60 HgManifest.Flags f = flagsMap.get(fname); |
61 return f == null ? HgManifest.Flags.RegularFile : f; | 61 return f == null ? HgManifest.Flags.RegularFile : f; |
62 } | 62 } |
63 | 63 |
64 /** | 64 /** |
65 * @return identifier of the changeset this manifest revision corresponds to. | 65 * @return identifier of this manifest revision |
66 */ | 66 */ |
67 public Nodeid changeset() { | 67 public Nodeid revision() { |
68 return changeset; | 68 return manifestRev; |
69 } | 69 } |
70 | 70 |
71 public int changesetLocalRev() { | 71 public int revisionIndex() { |
72 return changelogRev; | 72 return manifestRevIndex; |
73 } | |
74 | |
75 /** | |
76 * @return revision index for the changelog this manifest revision is linked to | |
77 */ | |
78 public int changesetRevisionIndex() { | |
79 return changelogRevIndex; | |
73 } | 80 } |
74 | 81 |
75 // | 82 // |
76 | 83 |
77 public boolean next(Nodeid nid, Path fname, HgManifest.Flags flags) { | 84 public boolean next(Nodeid nid, Path fname, HgManifest.Flags flags) { |
98 public boolean end(int revision) { | 105 public boolean end(int revision) { |
99 // in fact, this class cares about single revision | 106 // in fact, this class cares about single revision |
100 return false; | 107 return false; |
101 } | 108 } |
102 | 109 |
103 public boolean begin(int revision, Nodeid nid, int changelogRevision) { | 110 public boolean begin(int revisionIndex, Nodeid revision, int changelogRevisionIndex) { |
104 if (changeset != null) { | 111 if (manifestRev != null) { |
105 idsMap.clear(); | 112 idsMap.clear(); |
106 flagsMap.clear(); | 113 flagsMap.clear(); |
107 } | 114 } |
108 changeset = nid; | 115 manifestRev = revision; |
109 changelogRev = changelogRevision; | 116 manifestRevIndex = revisionIndex; |
117 changelogRevIndex = changelogRevisionIndex; | |
110 return true; | 118 return true; |
111 } | 119 } |
112 } | 120 } |