diff src/org/tmatesoft/hg/core/HgManifestCommand.java @ 285:6dbbc53fc46d

Use Path instead of plain String for manifest file names
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sat, 03 Sep 2011 21:46:13 +0200
parents 4c3b9f679412
children 189dc6dc1c3e
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgManifestCommand.java	Sat Sep 03 13:12:13 2011 +0200
+++ b/src/org/tmatesoft/hg/core/HgManifestCommand.java	Sat Sep 03 21:46:13 2011 +0200
@@ -27,6 +27,7 @@
 
 import org.tmatesoft.hg.repo.HgManifest;
 import org.tmatesoft.hg.repo.HgRepository;
+import org.tmatesoft.hg.repo.HgManifest.Flags;
 import org.tmatesoft.hg.util.Path;
 import org.tmatesoft.hg.util.PathPool;
 import org.tmatesoft.hg.util.PathRewrite;
@@ -128,7 +129,7 @@
 	}
 
 	// I'd rather let HgManifestCommand implement HgManifest.Inspector directly, but this pollutes API alot
-	private class Mediator implements HgManifest.Inspector {
+	private class Mediator implements HgManifest.Inspector2 {
 		// file names are likely to repeat in each revision, hence caching of Paths.
 		// However, once HgManifest.Inspector switches to Path objects, perhaps global Path pool
 		// might be more effective?
@@ -179,11 +180,14 @@
 			return true;
 		}
 		public boolean next(Nodeid nid, String fname, String flags) {
-			Path p = pathPool.path(fname);
-			if (matcher != null && !matcher.accept(p)) {
+			throw new HgBadStateException(HgManifest.Inspector2.class.getName());
+		}
+		
+		public boolean next(Nodeid nid, Path fname, Flags flags) {
+			if (matcher != null && !matcher.accept(fname)) {
 				return true;
 			}
-			HgFileRevision fr = new HgFileRevision(repo, nid, p);
+			HgFileRevision fr = new HgFileRevision(repo, nid, fname);
 			if (needDirs) {
 				manifestContent.add(fr);
 			} else {