diff src/org/tmatesoft/hg/core/HgCloneCommand.java @ 202:706bcc7cfee4

Basic test for HgIncomingCommand. Fix RepositoryComparator for cases when whole repository is unknown. Respect freshly initialized (empty) repositories in general.
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 26 Apr 2011 02:50:06 +0200
parents 9b99d27aeddc
children 883f1efbcf27
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgCloneCommand.java	Thu Apr 21 19:16:45 2011 +0200
+++ b/src/org/tmatesoft/hg/core/HgCloneCommand.java	Tue Apr 26 02:50:06 2011 +0200
@@ -123,20 +123,17 @@
 		private final ArrayList<Nodeid> revisionSequence = new ArrayList<Nodeid>(); // last visited nodes first
 
 		private final LinkedList<String> fncacheFiles = new LinkedList<String>();
+		private Internals implHelper;
 
 		public WriteDownMate(File destDir) {
 			hgDir = new File(destDir, ".hg");
-			Internals i = new Internals();
-			i.setStorageConfig(1, STORE | FNCACHE | DOTENCODE);
-			storagePathHelper = i.buildDataFilesHelper();
+			implHelper = new Internals();
+			implHelper.setStorageConfig(1, STORE | FNCACHE | DOTENCODE);
+			storagePathHelper = implHelper.buildDataFilesHelper();
 		}
 
 		public void initEmptyRepository() throws IOException {
-			hgDir.mkdir();
-			FileOutputStream requiresFile = new FileOutputStream(new File(hgDir, "requires"));
-			requiresFile.write("revlogv1\nstore\nfncache\ndotencode\n".getBytes());
-			requiresFile.close();
-			new File(hgDir, "store").mkdir(); // with that, hg verify says ok.
+			implHelper.initEmptyRepository(hgDir);
 		}
 
 		public void complete() throws IOException {