comparison 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
comparison
equal deleted inserted replaced
201:a736f42ed75b 202:706bcc7cfee4
121 private DataAccess prevRevContent; 121 private DataAccess prevRevContent;
122 private final DigestHelper dh = new DigestHelper(); 122 private final DigestHelper dh = new DigestHelper();
123 private final ArrayList<Nodeid> revisionSequence = new ArrayList<Nodeid>(); // last visited nodes first 123 private final ArrayList<Nodeid> revisionSequence = new ArrayList<Nodeid>(); // last visited nodes first
124 124
125 private final LinkedList<String> fncacheFiles = new LinkedList<String>(); 125 private final LinkedList<String> fncacheFiles = new LinkedList<String>();
126 private Internals implHelper;
126 127
127 public WriteDownMate(File destDir) { 128 public WriteDownMate(File destDir) {
128 hgDir = new File(destDir, ".hg"); 129 hgDir = new File(destDir, ".hg");
129 Internals i = new Internals(); 130 implHelper = new Internals();
130 i.setStorageConfig(1, STORE | FNCACHE | DOTENCODE); 131 implHelper.setStorageConfig(1, STORE | FNCACHE | DOTENCODE);
131 storagePathHelper = i.buildDataFilesHelper(); 132 storagePathHelper = implHelper.buildDataFilesHelper();
132 } 133 }
133 134
134 public void initEmptyRepository() throws IOException { 135 public void initEmptyRepository() throws IOException {
135 hgDir.mkdir(); 136 implHelper.initEmptyRepository(hgDir);
136 FileOutputStream requiresFile = new FileOutputStream(new File(hgDir, "requires"));
137 requiresFile.write("revlogv1\nstore\nfncache\ndotencode\n".getBytes());
138 requiresFile.close();
139 new File(hgDir, "store").mkdir(); // with that, hg verify says ok.
140 } 137 }
141 138
142 public void complete() throws IOException { 139 public void complete() throws IOException {
143 FileOutputStream fncacheFile = new FileOutputStream(new File(hgDir, "store/fncache")); 140 FileOutputStream fncacheFile = new FileOutputStream(new File(hgDir, "store/fncache"));
144 for (String s : fncacheFiles) { 141 for (String s : fncacheFiles) {