# HG changeset patch # User Artem Tikhomirov # Date 1315959167 -7200 # Node ID 1483e57541ef1d8db899b70e6d70fa69202d21b3 # Parent 8faad08c709b8d16751e1476e7b6df224c00c434 Refactor PathRewrite to accept any char sequence, not only string diff -r 8faad08c709b -r 1483e57541ef src/org/tmatesoft/hg/repo/HgDirstate.java --- a/src/org/tmatesoft/hg/repo/HgDirstate.java Wed Sep 14 01:52:41 2011 +0200 +++ b/src/org/tmatesoft/hg/repo/HgDirstate.java Wed Sep 14 02:12:47 2011 +0200 @@ -33,6 +33,7 @@ import org.tmatesoft.hg.util.Pair; import org.tmatesoft.hg.util.Path; import org.tmatesoft.hg.util.PathPool; +import org.tmatesoft.hg.util.PathRewrite; /** @@ -51,17 +52,21 @@ private final HgRepository repo; private final File dirstateFile; private final PathPool pathPool; + private final PathRewrite canonicalPathRewrite; private Map normal; private Map added; private Map removed; private Map merged; + private Map canonical2dirstate; // map of canonicalized file names to their originals from dirstate file private Pair parents; private String currentBranch; - /*package-local*/ HgDirstate(HgRepository hgRepo, File dirstate, PathPool pathPool) { + // canonicalPath may be null if we don't need to check for names other than in dirstate + /*package-local*/ HgDirstate(HgRepository hgRepo, File dirstate, PathPool pathPool, PathRewrite canonicalPath) { repo = hgRepo; dirstateFile = dirstate; // XXX decide whether file names shall be kept local to reader (see #branches()) or passed from outside this.pathPool = pathPool; + canonicalPathRewrite = canonicalPath; } private void read() {