Mercurial > hg4j
diff src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.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 | cd658b24a620 |
children | 909306e412e2 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java Thu Mar 29 18:48:23 2012 +0200 +++ b/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java Thu Mar 29 20:54:04 2012 +0200 @@ -37,17 +37,18 @@ import org.tmatesoft.hg.internal.FilterByteChannel; import org.tmatesoft.hg.internal.Internals; import org.tmatesoft.hg.internal.ManifestRevision; +import org.tmatesoft.hg.internal.PathPool; import org.tmatesoft.hg.internal.PathScope; import org.tmatesoft.hg.internal.Preview; import org.tmatesoft.hg.util.Adaptable; import org.tmatesoft.hg.util.ByteChannel; import org.tmatesoft.hg.util.CancelSupport; import org.tmatesoft.hg.util.CancelledException; +import org.tmatesoft.hg.util.Convertor; import org.tmatesoft.hg.util.FileInfo; import org.tmatesoft.hg.util.FileIterator; import org.tmatesoft.hg.util.FileWalker; import org.tmatesoft.hg.util.Path; -import org.tmatesoft.hg.util.PathPool; import org.tmatesoft.hg.util.PathRewrite; import org.tmatesoft.hg.util.RegularFileInfo; @@ -62,7 +63,7 @@ private final FileIterator repoWalker; private HgDirstate dirstate; private HgStatusCollector baseRevisionCollector; - private PathPool pathPool; + private Convertor<Path> pathPool; private ManifestRevision dirstateParentManifest; /** @@ -92,7 +93,7 @@ baseRevisionCollector = sc; } - /*package-local*/ PathPool getPathPool() { + /*package-local*/ Convertor<Path> getPathPool() { if (pathPool == null) { if (baseRevisionCollector == null) { pathPool = new PathPool(new PathRewrite.Empty()); @@ -103,8 +104,8 @@ return pathPool; } - public void setPathPool(PathPool pathPool) { - this.pathPool = pathPool; + public void setPathPool(Convertor<Path> pathConvertor) { + pathPool = pathConvertor; } /** @@ -113,7 +114,14 @@ */ public HgDirstate getDirstate() throws HgInvalidControlFileException { if (dirstate == null) { - dirstate = repo.loadDirstate(getPathPool()); + Convertor<Path> pp = getPathPool(); + Path.Source ps; + if (pp instanceof Path.Source) { + ps = (Path.Source) pp; + } else { + ps = new Path.SimpleSource(new PathRewrite.Empty(), pp); + } + dirstate = repo.loadDirstate(ps); } return dirstate; } @@ -206,7 +214,7 @@ while (repoWalker.hasNext()) { cs.checkCancelled(); repoWalker.next(); - final Path fname = getPathPool().path(repoWalker.name()); + final Path fname = getPathPool().mangle(repoWalker.name()); FileInfo f = repoWalker.file(); Path knownInDirstate; if (!f.exists()) { @@ -385,7 +393,7 @@ try { Path origin = HgStatusCollector.getOriginIfCopy(repo, fname, baseRevNames, baseRevision); if (origin != null) { - inspector.copied(getPathPool().path(origin), fname); + inspector.copied(getPathPool().mangle(origin), fname); return; } } catch (HgInvalidFileException ex) {