comparison src/org/tmatesoft/hg/repo/HgDirstate.java @ 431:12f668401613

FIXMEs: awkward API refactored, what need to be internal got hidden; public aspects got captured in slim interfaces
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 29 Mar 2012 20:54:04 +0200
parents d280759c2a3f
children 909306e412e2
comparison
equal deleted inserted replaced
430:d280759c2a3f 431:12f668401613
32 import org.tmatesoft.hg.core.Nodeid; 32 import org.tmatesoft.hg.core.Nodeid;
33 import org.tmatesoft.hg.internal.DataAccess; 33 import org.tmatesoft.hg.internal.DataAccess;
34 import org.tmatesoft.hg.internal.EncodingHelper; 34 import org.tmatesoft.hg.internal.EncodingHelper;
35 import org.tmatesoft.hg.util.Pair; 35 import org.tmatesoft.hg.util.Pair;
36 import org.tmatesoft.hg.util.Path; 36 import org.tmatesoft.hg.util.Path;
37 import org.tmatesoft.hg.util.PathPool;
38 import org.tmatesoft.hg.util.PathRewrite; 37 import org.tmatesoft.hg.util.PathRewrite;
39 38
40 39
41 /** 40 /**
42 * @see http://mercurial.selenic.com/wiki/DirState 41 * @see http://mercurial.selenic.com/wiki/DirState
51 Normal, Added, Removed, Merged, // order is being used in code of this class, don't change unless any use is checked 50 Normal, Added, Removed, Merged, // order is being used in code of this class, don't change unless any use is checked
52 } 51 }
53 52
54 private final HgRepository repo; 53 private final HgRepository repo;
55 private final File dirstateFile; 54 private final File dirstateFile;
56 private final PathPool pathPool; 55 private final Path.Source pathPool;
57 private final PathRewrite canonicalPathRewrite; 56 private final PathRewrite canonicalPathRewrite;
58 private Map<Path, Record> normal; 57 private Map<Path, Record> normal;
59 private Map<Path, Record> added; 58 private Map<Path, Record> added;
60 private Map<Path, Record> removed; 59 private Map<Path, Record> removed;
61 private Map<Path, Record> merged; 60 private Map<Path, Record> merged;
64 */ 63 */
65 private Map<Path, Path> canonical2dirstateName; 64 private Map<Path, Path> canonical2dirstateName;
66 private Pair<Nodeid, Nodeid> parents; 65 private Pair<Nodeid, Nodeid> parents;
67 66
68 // canonicalPath may be null if we don't need to check for names other than in dirstate 67 // canonicalPath may be null if we don't need to check for names other than in dirstate
69 /*package-local*/ HgDirstate(HgRepository hgRepo, File dirstate, PathPool pathPool, PathRewrite canonicalPath) { 68 /*package-local*/ HgDirstate(HgRepository hgRepo, File dirstate, Path.Source pathSource, PathRewrite canonicalPath) {
70 repo = hgRepo; 69 repo = hgRepo;
71 dirstateFile = dirstate; // XXX decide whether file names shall be kept local to reader (see #branches()) or passed from outside 70 dirstateFile = dirstate; // XXX decide whether file names shall be kept local to reader (see #branches()) or passed from outside
72 this.pathPool = pathPool; 71 pathPool = pathSource;
73 canonicalPathRewrite = canonicalPath; 72 canonicalPathRewrite = canonicalPath;
74 } 73 }
75 74
76 /*package-local*/ void read(EncodingHelper encodingHelper) throws HgInvalidControlFileException { 75 /*package-local*/ void read(EncodingHelper encodingHelper) throws HgInvalidControlFileException {
77 normal = added = removed = merged = Collections.<Path, Record>emptyMap(); 76 normal = added = removed = merged = Collections.<Path, Record>emptyMap();