diff src/org/tmatesoft/hg/internal/RepoInitializer.java @ 637:4a0bab2c6da1

HgInitCommand: expose repo init functionality
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 07 Jun 2013 12:32:15 +0200
parents 4e6179bde4fc
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/RepoInitializer.java	Thu Jun 06 19:39:06 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/RepoInitializer.java	Fri Jun 07 12:32:15 2013 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 TMate Software Ltd
+ * Copyright (c) 2012-2013 TMate Software Ltd
  *  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@
  * Responsible of `requires` processing both on repo read and repo write
  * XXX needs better name, perhaps
  * 
+ * @see http://mercurial.selenic.com/wiki/RequiresFile
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
@@ -66,7 +67,9 @@
 		try {
 			FileOutputStream requiresStream = new FileOutputStream(requiresFile);
 			StringBuilder sb = new StringBuilder(40);
-			sb.append("revlogv1\n");
+			if ((requiresFlags & REVLOGV1) != 0) {
+				sb.append("revlogv1\n");
+			}
 			if ((requiresFlags & STORE) != 0) {
 				sb.append("store\n");
 			}
@@ -81,7 +84,9 @@
 		} catch (IOException ex) {
 			throw new HgIOException("Failed to initialize empty repo", ex, requiresFile);
 		}
-		new File(repoDir, "store").mkdir(); // with that, hg verify says ok.
+		if ((requiresFlags & STORE) != 0) {
+			new File(repoDir, "store").mkdir(); // with that, hg verify says ok.
+		}
 	}
 
 	public PathRewrite buildDataFilesHelper(SessionContext ctx) {