Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgManifest.java @ 456:909306e412e2
Refactor LogFacility and SessionContext, better API for both
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> | 
|---|---|
| date | Mon, 18 Jun 2012 16:54:00 +0200 | 
| parents | 12f668401613 | 
| children | b3c16d1aede0 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 454:36fd1fd06492 | 456:909306e412e2 | 
|---|---|
| 16 */ | 16 */ | 
| 17 package org.tmatesoft.hg.repo; | 17 package org.tmatesoft.hg.repo; | 
| 18 | 18 | 
| 19 import static org.tmatesoft.hg.core.Nodeid.NULL; | 19 import static org.tmatesoft.hg.core.Nodeid.NULL; | 
| 20 import static org.tmatesoft.hg.repo.HgRepository.*; | 20 import static org.tmatesoft.hg.repo.HgRepository.*; | 
| 21 import static org.tmatesoft.hg.util.LogFacility.Severity.Info; | |
| 21 | 22 | 
| 22 import java.io.ByteArrayOutputStream; | 23 import java.io.ByteArrayOutputStream; | 
| 23 import java.io.IOException; | 24 import java.io.IOException; | 
| 24 import java.util.ArrayList; | 25 import java.util.ArrayList; | 
| 25 import java.util.Arrays; | 26 import java.util.Arrays; | 
| 36 import org.tmatesoft.hg.internal.IdentityPool; | 37 import org.tmatesoft.hg.internal.IdentityPool; | 
| 37 import org.tmatesoft.hg.internal.RevlogStream; | 38 import org.tmatesoft.hg.internal.RevlogStream; | 
| 38 import org.tmatesoft.hg.util.CancelSupport; | 39 import org.tmatesoft.hg.util.CancelSupport; | 
| 39 import org.tmatesoft.hg.util.Path; | 40 import org.tmatesoft.hg.util.Path; | 
| 40 import org.tmatesoft.hg.util.ProgressSupport; | 41 import org.tmatesoft.hg.util.ProgressSupport; | 
| 42 import org.tmatesoft.hg.util.LogFacility.Severity; | |
| 41 | 43 | 
| 42 | 44 | 
| 43 /** | 45 /** | 
| 44 * Representation of Mercurial manifest file (list of file names and their revisions in a particular changeset) | 46 * Representation of Mercurial manifest file (list of file names and their revisions in a particular changeset) | 
| 45 * | 47 * | 
| 165 inspector.end(NO_REVISION); | 167 inspector.end(NO_REVISION); | 
| 166 } | 168 } | 
| 167 i++; | 169 i++; | 
| 168 } while (manifestFirst == BAD_REVISION && csetFirst+i <= csetLast); | 170 } while (manifestFirst == BAD_REVISION && csetFirst+i <= csetLast); | 
| 169 if (manifestFirst == BAD_REVISION) { | 171 if (manifestFirst == BAD_REVISION) { | 
| 170 getRepo().getContext().getLog().info(getClass(), "None of changesets [%d..%d] have associated manifest revision", csetFirst, csetLast); | 172 getRepo().getContext().getLog().dump(getClass(), Info, "None of changesets [%d..%d] have associated manifest revision", csetFirst, csetLast); | 
| 171 // we ran through all revisions in [start..end] and none of them had manifest. | 173 // we ran through all revisions in [start..end] and none of them had manifest. | 
| 172 // we reported that to inspector and proceeding is done now. | 174 // we reported that to inspector and proceeding is done now. | 
| 173 return; | 175 return; | 
| 174 } | 176 } | 
| 175 i = 0; | 177 i = 0; | 
| 614 for (int u : undefinedChangelogRevision) { | 616 for (int u : undefinedChangelogRevision) { | 
| 615 Nodeid manifest = repo.getChangelog().range(u, u).get(0).manifest(); | 617 Nodeid manifest = repo.getChangelog().range(u, u).get(0).manifest(); | 
| 616 // TODO calculate those missing effectively (e.g. cache and sort nodeids to speed lookup | 618 // TODO calculate those missing effectively (e.g. cache and sort nodeids to speed lookup | 
| 617 // right away in the #next (may refactor ParentWalker's sequential and sorted into dedicated helper and reuse here) | 619 // right away in the #next (may refactor ParentWalker's sequential and sorted into dedicated helper and reuse here) | 
| 618 if (manifest.isNull()) { | 620 if (manifest.isNull()) { | 
| 619 repo.getContext().getLog().warn(getClass(), "Changeset %d has no associated manifest entry", u); | 621 repo.getContext().getLog().dump(getClass(), Severity.Warn, "Changeset %d has no associated manifest entry", u); | 
| 620 // keep -1 in the changelog2manifest map. | 622 // keep -1 in the changelog2manifest map. | 
| 621 } else { | 623 } else { | 
| 622 changelog2manifest[u] = repo.getManifest().getRevisionIndex(manifest); | 624 changelog2manifest[u] = repo.getManifest().getRevisionIndex(manifest); | 
| 623 } | 625 } | 
| 624 } | 626 } | 
