diff src/org/tmatesoft/hg/core/HgCloneCommand.java @ 571:e4ee4bf4c7d0

Let session context control creation of Path instances
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 11 Apr 2013 16:27:06 +0200
parents 9edfd5a223b8
children 5e0313485eef
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgCloneCommand.java	Thu Apr 11 16:07:17 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgCloneCommand.java	Thu Apr 11 16:27:06 2013 +0200
@@ -146,6 +146,7 @@
 		private final ProgressSupport progressSupport;
 		private final CancelSupport cancelSupport;
 		private final SessionContext ctx;
+		private final Path.Source pathFactory;
 		private FileOutputStream indexFile;
 		private String filename; // human-readable name of the file being written, for log/exception purposes 
 
@@ -174,6 +175,7 @@
 			progressSupport = progress;
 			cancelSupport = cancel;
 			revlogDataZip = new RevlogCompressor(sessionCtx);
+			pathFactory = ctx.getPathFactory();
 		}
 
 		public void initEmptyRepository() throws IOException {
@@ -243,7 +245,7 @@
 			try {
 				revlogHeader.offset(0).baseRevision(-1);
 				revisionSequence.clear();
-				fncacheFile.add(Path.create(name)); 
+				fncacheFile.add(pathFactory.path(name)); 
 				File file = new File(hgDir, filename = storagePathHelper.rewrite(name).toString());
 				file.getParentFile().mkdirs();
 				indexFile = new FileOutputStream(file);