comparison src/org/tmatesoft/hg/core/HgCloneCommand.java @ 616:5e0313485eef

encode directories as demanded by fncache format
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 14 May 2013 17:31:35 +0200
parents e4ee4bf4c7d0
children 7c0d2ce340b8
comparison
equal deleted inserted replaced
615:84104448a0bf 616:5e0313485eef
243 243
244 public void fileStart(String name) { 244 public void fileStart(String name) {
245 try { 245 try {
246 revlogHeader.offset(0).baseRevision(-1); 246 revlogHeader.offset(0).baseRevision(-1);
247 revisionSequence.clear(); 247 revisionSequence.clear();
248 fncacheFile.add(pathFactory.path(name));
249 File file = new File(hgDir, filename = storagePathHelper.rewrite(name).toString()); 248 File file = new File(hgDir, filename = storagePathHelper.rewrite(name).toString());
250 file.getParentFile().mkdirs(); 249 file.getParentFile().mkdirs();
251 indexFile = new FileOutputStream(file); 250 indexFile = new FileOutputStream(file);
252 } catch (IOException ex) { 251 } catch (IOException ex) {
253 String m = String.format("Failed to write file %s", filename); 252 String m = String.format("Failed to write file %s", filename);
256 stopIfCancelled(); 255 stopIfCancelled();
257 } 256 }
258 257
259 public void fileEnd(String name) { 258 public void fileEnd(String name) {
260 try { 259 try {
260 fncacheFile.addIndex(pathFactory.path(name));
261 clearPreviousContent(); 261 clearPreviousContent();
262 closeIndexFile(); 262 closeIndexFile();
263 } catch (IOException ex) { 263 } catch (IOException ex) {
264 String m = String.format("Failed to write file %s", filename); 264 String m = String.format("Failed to write file %s", filename);
265 throw new HgInvalidControlFileException(m, ex, new File(filename)); 265 throw new HgInvalidControlFileException(m, ex, new File(filename));