comparison src/org/tmatesoft/hg/repo/HgManifest.java @ 220:8de327242aa0

Basic information about branches
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 19 May 2011 04:14:45 +0200
parents 047b1dec7a04
children 373e07cd3991
comparison
equal deleted inserted replaced
219:d63583b47bfa 220:8de327242aa0
147 return revisionNumber; 147 return revisionNumber;
148 } 148 }
149 149
150 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, DataAccess data) { 150 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, DataAccess data) {
151 if (changelog2manifest != null) { 151 if (changelog2manifest != null) {
152 // next assertion is not an error, rather assumption check, which is too development-related to be explicit exception -
153 // I just wonder if there are manifests that have two entries pointing to single changeset. It seems unrealistic, though -
154 // changeset records one and only one manifest nodeid
155 assert changelog2manifest[linkRevision] == -1 : String.format("revision:%d, link:%d, already linked to revision:%d", revisionNumber, linkRevision, changelog2manifest[linkRevision]);
152 changelog2manifest[linkRevision] = revisionNumber; 156 changelog2manifest[linkRevision] = revisionNumber;
153 } else { 157 } else {
154 if (revisionNumber != linkRevision) { 158 if (revisionNumber != linkRevision) {
155 changelog2manifest = new int[changelogRevisions]; 159 changelog2manifest = new int[changelogRevisions];
156 Arrays.fill(changelog2manifest, -1); 160 Arrays.fill(changelog2manifest, -1);
184 undefinedChangelogRevision.add(i); 188 undefinedChangelogRevision.add(i);
185 } 189 }
186 } 190 }
187 for (int u : undefinedChangelogRevision) { 191 for (int u : undefinedChangelogRevision) {
188 Nodeid manifest = repo.getChangelog().range(u, u).get(0).manifest(); 192 Nodeid manifest = repo.getChangelog().range(u, u).get(0).manifest();
189 // FIXME calculate those missing effectively (e.g. cache and sort nodeids to spead lookup 193 // FIXME calculate those missing effectively (e.g. cache and sort nodeids to speed lookup
190 // right away in the #next (may refactor ParentWalker's sequential and sorted into dedicated helper and reuse here) 194 // right away in the #next (may refactor ParentWalker's sequential and sorted into dedicated helper and reuse here)
191 changelog2manifest[u] = repo.getManifest().getLocalRevision(manifest); 195 changelog2manifest[u] = repo.getManifest().getLocalRevision(manifest);
192 } 196 }
193 } 197 }
194 } 198 }