comparison src/org/tmatesoft/hg/core/HgManifestCommand.java @ 142:37a34044e6bd

More reasonable use of path normalizer and path.source
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 17 Feb 2011 05:06:07 +0100
parents 4a948ec83980
children b9700740553a
comparison
equal deleted inserted replaced
141:8248aae33f7d 142:37a34044e6bd
26 import org.tmatesoft.hg.core.HgLogCommand.FileRevision; 26 import org.tmatesoft.hg.core.HgLogCommand.FileRevision;
27 import org.tmatesoft.hg.repo.HgManifest; 27 import org.tmatesoft.hg.repo.HgManifest;
28 import org.tmatesoft.hg.repo.HgRepository; 28 import org.tmatesoft.hg.repo.HgRepository;
29 import org.tmatesoft.hg.util.Path; 29 import org.tmatesoft.hg.util.Path;
30 import org.tmatesoft.hg.util.PathPool; 30 import org.tmatesoft.hg.util.PathPool;
31 import org.tmatesoft.hg.util.PathRewrite;
31 32
32 33
33 /** 34 /**
34 * Gives access to list of files in each revision (Mercurial manifest information), 'hg manifest' counterpart. 35 * Gives access to list of files in each revision (Mercurial manifest information), 'hg manifest' counterpart.
35 * 36 *
104 void end(Nodeid manifestRevision); 105 void end(Nodeid manifestRevision);
105 } 106 }
106 107
107 // I'd rather let HgManifestCommand implement HgManifest.Inspector directly, but this pollutes API alot 108 // I'd rather let HgManifestCommand implement HgManifest.Inspector directly, but this pollutes API alot
108 private class Mediator implements HgManifest.Inspector { 109 private class Mediator implements HgManifest.Inspector {
110 // file names are likely to repeat in each revision, hence caching of Paths.
111 // However, once HgManifest.Inspector switches to Path objects, perhaps global Path pool
112 // might be more effective?
109 private PathPool pathPool; 113 private PathPool pathPool;
110 private List<FileRevision> manifestContent; 114 private List<FileRevision> manifestContent;
111 private Nodeid manifestNodeid; 115 private Nodeid manifestNodeid;
112 116
113 public void start() { 117 public void start() {
114 pathPool = new PathPool(repo.getPathHelper()); 118 // Manifest keeps normalized paths
119 pathPool = new PathPool(new PathRewrite.Empty());
115 } 120 }
116 121
117 public void done() { 122 public void done() {
118 manifestContent = null; 123 manifestContent = null;
119 pathPool = null; 124 pathPool = null;