diff src/org/tmatesoft/hg/internal/WorkingDirFileWriter.java @ 526:2f9ed6bcefa2

Initial support for Revert command with accompanying minor refactoring
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 15 Jan 2013 17:07:19 +0100
parents 0be5be8d57e9
children becd2a1310a2
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/WorkingDirFileWriter.java	Fri Jan 11 18:12:39 2013 +0100
+++ b/src/org/tmatesoft/hg/internal/WorkingDirFileWriter.java	Tue Jan 15 17:07:19 2013 +0100
@@ -23,11 +23,10 @@
 import java.nio.channels.FileChannel;
 
 import org.tmatesoft.hg.repo.HgDataFile;
-import org.tmatesoft.hg.repo.HgRepository;
 import org.tmatesoft.hg.util.ByteChannel;
 import org.tmatesoft.hg.util.CancelledException;
+import org.tmatesoft.hg.util.LogFacility.Severity;
 import org.tmatesoft.hg.util.Path;
-import org.tmatesoft.hg.util.LogFacility.Severity;
 
 /**
  * 
@@ -37,13 +36,13 @@
 public class WorkingDirFileWriter implements ByteChannel {
 
 	
-	private final HgRepository repo;
+	private final Internals hgRepo;
 	private File dest;
 	private FileChannel destChannel;
 	private int totalBytesWritten;
 
-	public WorkingDirFileWriter(HgRepository hgRepo) {
-		repo = hgRepo;
+	public WorkingDirFileWriter(Internals internalRepo) {
+		hgRepo = internalRepo;
 	}
 	
 	public void processFile(HgDataFile df, int fileRevIndex) throws IOException {
@@ -51,14 +50,14 @@
 			prepare(df.getPath());
 			df.contentWithFilters(fileRevIndex, this);
 		} catch (CancelledException ex) {
-			repo.getSessionContext().getLog().dump(getClass(), Severity.Error, ex, "Our impl doesn't throw cancellation");
+			hgRepo.getSessionContext().getLog().dump(getClass(), Severity.Error, ex, "Our impl doesn't throw cancellation");
 		}
 		finish();
 	}
 
 	public void prepare(Path fname) throws IOException {
 		String fpath = fname.toString();
-		dest = new File(repo.getWorkingDir(), fpath);
+		dest = new File(hgRepo.getRepo().getWorkingDir(), fpath);
 		if (fpath.indexOf('/') != -1) {
 			dest.getParentFile().mkdirs();
 		}