diff src/org/tmatesoft/hg/core/HgCheckoutCommand.java @ 572:becd2a1310a2

Report file object in case of error to be helpful as much as possible
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 12 Apr 2013 18:30:55 +0200
parents 78a9e26e670d
children bd5926e24aa3
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgCheckoutCommand.java	Thu Apr 11 16:27:06 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgCheckoutCommand.java	Fri Apr 12 18:30:55 2013 +0200
@@ -191,17 +191,18 @@
 		}
 		
 		public boolean next(Nodeid nid, Path fname, Flags flags) {
+			WorkingDirFileWriter workingDirWriter = null;
 			try {
 				HgDataFile df = hgRepo.getRepo().getFileNode(fname);
 				int fileRevIndex = df.getRevisionIndex(nid);
 				// check out files based on manifest
 				// FIXME links!
-				WorkingDirFileWriter workingDirWriter = new WorkingDirFileWriter(hgRepo);
+				workingDirWriter = new WorkingDirFileWriter(hgRepo);
 				workingDirWriter.processFile(df, fileRevIndex);
 				lastWrittenFileSize = workingDirWriter.bytesWritten();
 				return true;
 			} catch (IOException ex) {
-				failure = new HgIOException("Failed to write down file revision", ex, /*FIXME file*/null);
+				failure = new HgIOException("Failed to write down file revision", ex, workingDirWriter.getDestinationFile());
 			} catch (HgRuntimeException ex) {
 				failure = new HgLibraryFailureException(ex);
 			}