comparison src/org/tmatesoft/hg/repo/HgDirstate.java @ 141:8248aae33f7d

Adopt FileIterator moving towards WCStatusCollector parameterizing. Improved path handling, move 'em around
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 17 Feb 2011 04:08:34 +0100
parents a3a2e5deb320
children 0fd10e5016dd
comparison
equal deleted inserted replaced
140:1c1891ad1c73 141:8248aae33f7d
23 import java.util.Map; 23 import java.util.Map;
24 import java.util.TreeSet; 24 import java.util.TreeSet;
25 25
26 import org.tmatesoft.hg.internal.DataAccess; 26 import org.tmatesoft.hg.internal.DataAccess;
27 import org.tmatesoft.hg.internal.DataAccessProvider; 27 import org.tmatesoft.hg.internal.DataAccessProvider;
28 import org.tmatesoft.hg.util.Path;
28 29
29 30
30 /** 31 /**
31 * @see http://mercurial.selenic.com/wiki/DirState 32 * @see http://mercurial.selenic.com/wiki/DirState
32 * @see http://mercurial.selenic.com/wiki/FileFormats#dirstate 33 * @see http://mercurial.selenic.com/wiki/FileFormats#dirstate
36 */ 37 */
37 class HgDirstate { 38 class HgDirstate {
38 39
39 private final DataAccessProvider accessProvider; 40 private final DataAccessProvider accessProvider;
40 private final File dirstateFile; 41 private final File dirstateFile;
42 // deliberate String, not Path as it seems useless to keep Path here
41 private Map<String, Record> normal; 43 private Map<String, Record> normal;
42 private Map<String, Record> added; 44 private Map<String, Record> added;
43 private Map<String, Record> removed; 45 private Map<String, Record> removed;
44 private Map<String, Record> merged; 46 private Map<String, Record> merged;
45 47
124 } 126 }
125 } 127 }
126 return rv; 128 return rv;
127 } 129 }
128 130
129 /*package-local*/ Record checkNormal(String fname) { 131 /*package-local*/ Record checkNormal(Path fname) {
130 return normal.get(fname); 132 return normal.get(fname.toString());
131 } 133 }
132 134
133 /*package-local*/ Record checkAdded(String fname) { 135 /*package-local*/ Record checkAdded(Path fname) {
134 return added.get(fname); 136 return added.get(fname.toString());
137 }
138 /*package-local*/ Record checkRemoved(Path fname) {
139 return removed.get(fname.toString());
135 } 140 }
136 /*package-local*/ Record checkRemoved(String fname) { 141 /*package-local*/ Record checkRemoved(String fname) {
137 return removed.get(fname); 142 return removed.get(fname);
138 } 143 }
139 /*package-local*/ Record checkMerged(String fname) { 144 /*package-local*/ Record checkMerged(Path fname) {
140 return merged.get(fname); 145 return merged.get(fname.toString());
141 } 146 }
142 147
143 148
144 149
145 150