Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgRepository.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 | 4a948ec83980 |
children | 37a34044e6bd |
comparison
equal
deleted
inserted
replaced
140:1c1891ad1c73 | 141:8248aae33f7d |
---|---|
25 import java.util.List; | 25 import java.util.List; |
26 | 26 |
27 import org.tmatesoft.hg.internal.ConfigFile; | 27 import org.tmatesoft.hg.internal.ConfigFile; |
28 import org.tmatesoft.hg.internal.DataAccessProvider; | 28 import org.tmatesoft.hg.internal.DataAccessProvider; |
29 import org.tmatesoft.hg.internal.Filter; | 29 import org.tmatesoft.hg.internal.Filter; |
30 import org.tmatesoft.hg.internal.RelativePathRewrite; | |
30 import org.tmatesoft.hg.internal.RequiresFile; | 31 import org.tmatesoft.hg.internal.RequiresFile; |
31 import org.tmatesoft.hg.internal.RevlogStream; | 32 import org.tmatesoft.hg.internal.RevlogStream; |
33 import org.tmatesoft.hg.util.FileIterator; | |
32 import org.tmatesoft.hg.util.FileWalker; | 34 import org.tmatesoft.hg.util.FileWalker; |
33 import org.tmatesoft.hg.util.Path; | 35 import org.tmatesoft.hg.util.Path; |
34 import org.tmatesoft.hg.util.PathRewrite; | 36 import org.tmatesoft.hg.util.PathRewrite; |
35 | 37 |
36 | 38 |
188 /*package-local*/ DataAccessProvider getDataAccess() { | 190 /*package-local*/ DataAccessProvider getDataAccess() { |
189 return dataAccess; | 191 return dataAccess; |
190 } | 192 } |
191 | 193 |
192 // FIXME not sure repository shall create walkers | 194 // FIXME not sure repository shall create walkers |
193 /*package-local*/ FileWalker createWorkingDirWalker() { | 195 /*package-local*/ FileIterator createWorkingDirWalker() { |
194 return new FileWalker(repoDir.getParentFile()); | 196 File repoRoot = repoDir.getParentFile(); |
197 Path.Source pathSrc = new Path.SimpleSource(new PathRewrite.Composite(new RelativePathRewrite(repoRoot), getPathHelper())); | |
198 // Impl note: simple source is enough as files in the working dir are all unique | |
199 // even if they might get reused (i.e. after FileIterator#reset() and walking once again), | |
200 // path caching is better to be done in the code which knows that path are being reused | |
201 return new FileWalker(repoRoot, pathSrc); | |
195 } | 202 } |
196 | 203 |
197 /** | 204 /** |
198 * Perhaps, should be separate interface, like ContentLookup | 205 * Perhaps, should be separate interface, like ContentLookup |
199 * path - repository storage path (i.e. one usually with .i or .d) | 206 * path - repository storage path (i.e. one usually with .i or .d) |