diff src/com/tmate/hgkit/ll/LocalHgRepo.java @ 64:19e9e220bf68

Convenient commands constitute hi-level API. org.tmatesoft namespace, GPL2 statement
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 21 Jan 2011 05:56:43 +0100
parents b771e94a4f7c
children
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/LocalHgRepo.java	Tue Jan 18 18:42:50 2011 +0100
+++ b/src/com/tmate/hgkit/ll/LocalHgRepo.java	Fri Jan 21 05:56:43 2011 +0100
@@ -13,6 +13,9 @@
 import java.util.HashMap;
 import java.util.TreeSet;
 
+import org.tmatesoft.hg.core.Path;
+import org.tmatesoft.hg.util.PathRewrite;
+
 import com.tmate.hgkit.fs.DataAccessProvider;
 import com.tmate.hgkit.fs.FileWalker;
 
@@ -24,6 +27,12 @@
 	private File repoDir; // .hg folder
 	private final String repoLocation;
 	private final DataAccessProvider dataAccess;
+	private final PathRewrite normalizePath = new PathRewrite() {
+		
+		public String rewrite(String path) {
+			return normalize(path);
+		}
+	};
 
 	public LocalHgRepo(String repositoryPath) {
 		setInvalid(true);
@@ -102,6 +111,16 @@
 		return new HgDataFile(this, nPath, content);
 	}
 
+	@Override
+	public HgDataFile getFileNode(Path path) {
+		return getFileNode(path.toString());
+	}
+	
+	@Override
+	public PathRewrite getPathHelper() {
+		return normalizePath;
+	}
+	
 	private boolean revlogv1;
 	private boolean store;
 	private boolean fncache;