Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgInternals.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 | 48f993aa2f41 |
| children | 6865eb742883 |
comparison
equal
deleted
inserted
replaced
| 430:d280759c2a3f | 431:12f668401613 |
|---|---|
| 31 import org.tmatesoft.hg.internal.RelativePathRewrite; | 31 import org.tmatesoft.hg.internal.RelativePathRewrite; |
| 32 import org.tmatesoft.hg.internal.WinToNixPathRewrite; | 32 import org.tmatesoft.hg.internal.WinToNixPathRewrite; |
| 33 import org.tmatesoft.hg.util.FileIterator; | 33 import org.tmatesoft.hg.util.FileIterator; |
| 34 import org.tmatesoft.hg.util.FileWalker; | 34 import org.tmatesoft.hg.util.FileWalker; |
| 35 import org.tmatesoft.hg.util.Path; | 35 import org.tmatesoft.hg.util.Path; |
| 36 import org.tmatesoft.hg.util.PathPool; | |
| 37 import org.tmatesoft.hg.util.PathRewrite; | 36 import org.tmatesoft.hg.util.PathRewrite; |
| 38 | 37 |
| 39 | 38 |
| 40 /** | 39 /** |
| 41 * DO NOT USE THIS CLASS, INTENDED FOR TESTING PURPOSES. | 40 * DO NOT USE THIS CLASS, INTENDED FOR TESTING PURPOSES. |
| 54 public HgInternals(HgRepository hgRepo) { | 53 public HgInternals(HgRepository hgRepo) { |
| 55 repo = hgRepo; | 54 repo = hgRepo; |
| 56 } | 55 } |
| 57 | 56 |
| 58 public HgDirstate getDirstate() throws HgInvalidControlFileException { | 57 public HgDirstate getDirstate() throws HgInvalidControlFileException { |
| 59 return repo.loadDirstate(new PathPool(new PathRewrite.Empty())); | 58 return repo.loadDirstate(new Path.SimpleSource()); |
| 60 } | 59 } |
| 61 | 60 |
| 62 // tests | 61 // tests |
| 63 public HgDirstate createDirstate(boolean caseSensitiveFileSystem) throws HgInvalidControlFileException { | 62 public HgDirstate createDirstate(boolean caseSensitiveFileSystem) throws HgInvalidControlFileException { |
| 64 PathRewrite canonicalPath = null; | 63 PathRewrite canonicalPath = null; |
| 68 public CharSequence rewrite(CharSequence path) { | 67 public CharSequence rewrite(CharSequence path) { |
| 69 return path.toString().toLowerCase(); | 68 return path.toString().toLowerCase(); |
| 70 } | 69 } |
| 71 }; | 70 }; |
| 72 } | 71 } |
| 73 HgDirstate ds = new HgDirstate(repo, new File(repo.getRepositoryRoot(), "dirstate"), new PathPool(new PathRewrite.Empty()), canonicalPath); | 72 HgDirstate ds = new HgDirstate(repo, new File(repo.getRepositoryRoot(), "dirstate"), new Path.SimpleSource(), canonicalPath); |
| 74 ds.read(repo.getImplHelper().buildFileNameEncodingHelper()); | 73 ds.read(repo.getImplHelper().buildFileNameEncodingHelper()); |
| 75 return ds; | 74 return ds; |
| 76 } | 75 } |
| 77 | 76 |
| 78 public Path[] checkKnown(HgDirstate dirstate, Path[] toCheck) { | 77 public Path[] checkKnown(HgDirstate dirstate, Path[] toCheck) { |
